The R Project SVN R

Rev

Rev 61150 | Rev 70587 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61150 Rev 61433
Line 108... Line 108...
108
l <- split(airquality, g)
108
l <- split(airquality, g)
109
l <- lapply(l, transform, Oz.Z = scale(Ozone))
109
l <- lapply(l, transform, Oz.Z = scale(Ozone))
110
aq2 <- unsplit(l, g)
110
aq2 <- unsplit(l, g)
111
head(aq2)
111
head(aq2)
112
with(aq2, tapply(Oz.Z,  Month, sd, na.rm = TRUE))
112
with(aq2, tapply(Oz.Z,  Month, sd, na.rm = TRUE))
113
 
113
 
114
 
114
 
115
### Split a matrix into a list by columns
115
### Split a matrix into a list by columns
116
ma <- cbind(x = 1:10, y = (-4:5)^2)
116
ma <- cbind(x = 1:10, y = (-4:5)^2)
117
split(ma, col(ma))
117
split(ma, col(ma))
118
 
118