Re: [R] how to work on multiple R objects?...

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Wed 04 Jan 2006 - 02:28:26 EST

On 1/3/06 10:24 AM, "Constantine Tsardounis" <costas.magnuse@gmail.com> wrote:

> Hello, Happy New Year!...
>
> I am encountering a problem trying to work on the data that I load in R.
>
> I have loaded to R a series of stock data using
> (csv files are named e.g. IBM.R)
>
> length.R <- length(list.files(".", pattern=".R")) # the number of
> files with one #column in the directory "./" ending to
> ".R"
> for (i in 1:length.R) {
> assign(read.csv(list.files(".", pattern=".R")[i],
> read.csv(list.files(".", pattern=".R")[i])))
> }

 mylist <- list()
 for (i in list.files('.',pattern='.R')) {    mylist[[i]] <- read.csv(i)
 }

Sean



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jan 04 02:35:12 2006

This archive was generated by hypermail 2.1.8 : Wed 04 Jan 2006 - 04:51:02 EST