R sapply()

1 개요[ | ]

R sapply()
x <- c(2,3,4)
x
sapply(x, function(n) { n*n }) ## [1]  4  9 16
x**2 ## [1]  4  9 16
movies <- c("SPYDERMAN","BATMAN","VERTIGO","CHINATOWN")
sapply(movies, tolower)
sapply(movies, nchar)
df <- read.table( header=TRUE, stringsAsFactors=FALSE, text="
English Math
     90   60
     80   70
     70   80
     60   90
")
df
colMeans(df)
sapply(df, mean)

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}