Top "Sapply" questions

sapply is a command in the R language that applies a function to each element of a vector (atomic or list).

Grouping functions (tapply, by, aggregate) and the *apply family

Whenever I want to do something "map"py in R, I usually try to use a function in the apply …

r lapply sapply tapply r-faq
Apply a function to every row of a matrix or a data frame

Suppose I have a n by 2 matrix and a function that takes a 2-vector as one of its arguments. I …

r function matrix apply sapply
Apply function to each column in a data frame observing each columns existing data type

I'm trying to get the min/max for each column in a large data frame, as part of getting to …

r apply sapply
How to subset from a list in R

I have a rather simple task but haven't find a good solution. > mylist [[1]] [1] 1 2 3 4 5 6 7 8 9 10 [[2]] [1] "a" "b" "c" "d" "e" "f" "…

r list sapply
Apply a function to each row in a data frame in R

Possible Duplicate: how to apply a function to every row of a matrix (or a data frame) in R R …

r dataframe sapply
Concatenate row-wise across specific columns of dataframe

I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the …

r apply paste string-concatenation sapply
R + combine a list of vectors into a single vector

I have a single list of numeric vector and I want to combine them into one vector. But I am …

r list vector append sapply
Convert a list of lists to a character vector

I have a list of lists of characters. For example: l <- list(list("A"),list("B"),list("C","…

r string list character sapply
How to pass na.rm=TRUE to sapply when calculating median?

I have created a dataframe "killers" with 3 variables. The data are numeric though there exist NA values throughout. My goal …

r na sapply na.rm
Repeating a user-defined function using replicate() or sapply()

I have defined a custom function, like this: my.fun = function() { for (i in 1:1000) { ... for (j in 1:20) { ... } } return(output) } which …

r sapply replicate