[R] read data into list of matrix
Greg.Snow at imail.org
Mon Apr 14 23:15:53 CEST 2008
Read the help page on '[', then read it again a couple more times (it
can be subtle). I think you want to use fp[] rather than fp, the
first will return a single element from the list (a data frame in the
case below), the second returns a list of length 1 (with that element
being a data frame, but wrapped in a list).
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Jonas Stein
> Sent: Monday, April 14, 2008 3:00 PM
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] read data into list of matrix
> >> i have a list of many files and want to load them into a list of
> >> tables, that can be adressed with a variable 'i'.
> > fp <- lapply(files, read.table, header = T)
> Thank you that works fine.
> But how can i access the data in column fp$foo now?
> fp$foo does not work.
> ps: thank you all for the replies per mail and the list here.
> Jonas Stein <news at jonasstein.de>
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help