Hi,
I am new to R and couldn't find any information on how to handle my table
data that I just read in the way I want to use it..
I read in a table from a file:
x <- read.delim("filenam", header=TRUE)
one column (x$label) hold the class labels. Another holds some values
(x$val).
I want to calculate summary statistics for different classes.
How would I do this?
Thanks,
Bernd
Hi, tapply(x$val, x$label, summary) On 25/10/2007, Bernd Jagla <baj2107@columbia.edu> wrote:> > Hi, > I am new to R and couldn't find any information on how to handle my table > data that I just read in the way I want to use it.. > > I read in a table from a file: > x <- read.delim("filenam", header=TRUE) > > one column (x$label) hold the class labels. Another holds some values > (x$val). > I want to calculate summary statistics for different classes. > > How would I do this? > > Thanks, > > Bernd > > ______________________________________________ > R-help@r-project.org 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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
Check out the tapply function. ?tapply Julian Bernd Jagla wrote:> Hi, > I am new to R and couldn't find any information on how to handle my table > data that I just read in the way I want to use it.. > > I read in a table from a file: > x <- read.delim("filenam", header=TRUE) > > one column (x$label) hold the class labels. Another holds some values > (x$val). > I want to calculate summary statistics for different classes. > > How would I do this? > > Thanks, > > Bernd > > ______________________________________________ > R-help at r-project.org 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.