Read the help page on '[', then read it again a couple more times (it
can be subtle).  I think you want to use fp[[1]] rather than fp[1], 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
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jonas Stein
> Sent: Monday, April 14, 2008 3:00 PM
> To: [EMAIL PROTECTED]
> 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[1]$foo does not work.
> 
> ps: thank you all for the replies per mail and the list here.
> 
> --
> Jonas Stein <[EMAIL PROTECTED]>
> 
> ______________________________________________
> 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.
> 

______________________________________________
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.

Reply via email to