I am trying to apply some transformations to all elements in a data frame.
When using regular application functions, I return a matrix, not a frame. Is there a way to directly get the data file without adding as.data.frame to each line?
df = data.frame(a = LETTERS[1:5], b = LETTERS[6:10]) apply(df, 1, tolower) #Matrix apply(df, 2, tolower) #Matrix sapply(df, tolower) #Matrix as.data.frame(sapply(df, tolower)) # Can I avoid "as.data.frame"?
source share