[R] Z score
ruipbarradas at sapo.pt
Wed Oct 24 12:17:36 CEST 2012
Try the following.
apply(MyFile, 1, scale)
Hope this helps,
Em 24-10-2012 07:17, Vedant Sharma escreveu:
> I need to find the z-score of the data present in a speardsheet. The values
> needs to be calculated for each gene across the samples (refer the
> example). And, it should be a simple thing, but I am unable to do it right
> now !
> The example re the structure of the spreadsheet is -
> # Example:
> MyFile <- read.csv( text=
> ", header=TRUE, row.names=1, as.is=TRUE, quote="'", na.strings="" )
> And, I think this formula that can be used for z score is -
> And, apply() function for rows should work. But bottomline - I am unable to
> do it correctly.
> Could you show me - using apply () or some other alternative function.
> Thank you.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help