hi there,
I need to subtract each value in the dataframe from the mean of the column
and divide by the
standard deviation of the column.
> dim(a)
[1] 22011 52
data2 <- sapply(seq(from = 2, by = 1, length = 50), function(e){
rbind((a[[e]] - mean(a[,e]))/sd(a[,e]))
})
Does this look right????
Any help would be appreciated.
Thanks
RT
--
View this message in context:
http://r.789695.n4.nabble.com/mean-and-sd-for-a-Dataframe-tp3298594p3298594.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.