"michael watson (IAH-C)" <[EMAIL PROTECTED]> writes:

> Hi
> 
> A simple question again, but I can't find it by google-ing R-help.
> 
> Quite simply, I want to read in the contents of a number of files, using
> read.table, and assign the results to elements of a
> vector/array/list/whatever.
> 
> I want it so that, if my vector/array/whatever is "pos", that pos[1]
> will give me the first data frame, pos[2] will give me the second etc...

No can do. pos[[1]] etc, however.... (pos[1] is another list, with one
element, in this case the first data frame)

x <- c("fee.dat","foe.dat","fie.dat","fum.dat")
lapply(x, read.table, header=TRUE) # or whatever is needed
 
> Kind of basic stuff I know... Sorry..


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

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

Reply via email to