Top "Sapply" questions

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

means and SD for columns in a dataframe with NA values

I'm trying to calculate the mean and standard deviation of several columns (except the first column) in a data.frame …

r mean sapply standard-deviation
Loop function and add columns to dataframe in R

I want to loop a function over dataframes and add information from the function to the data frame. I have …

r function loops mean sapply
R: Apply function on specific columns preserving the rest of the dataframe

I'd like to learn how to apply functions on specific columns of my dataframe without "excluding" the other columns from …

r dataframe sapply
Extract second subelement of every element in a list while ignoring NA's in sapply in R

I'm trying to extract the second subelement of every element in a list while ignoring NAs in R. Here's a …

r list apply na sapply
How do I count the number of words in a text (string)?

I have this string vector (for example): str <- c("this is a string current trey", "feather rtttt", "tusla", "…

regex r apply sapply
apply multiple functions in sapply

I have a list of .stat files in tmp directory. sample: a.stat=> abc,10 abc,20 abc,30 b.stat=> …

r sapply
sapply with custom function (series of if statements)

I want to run a function which looks at two vectors, returning different values depending on the signs of the …

r apply lapply sapply
R: How do you apply grep() in lapply()

I would like to apply grep() in R, but I am not really good in lapply(). I understand that lapply …

r lapply sapply tapply
Invalid Length Argument

I want to convert all the coloumns of my dataframe to numeric format. So I use lapply data.frame(lapply(…

r dataframe data-science sapply
sapply equivalent in python?

I need to grow a python DataFrame one row at a time. In R, the sapply() function is fast & …

python r sapply