Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
Thanks, David & Jean assign(), as you suggested works to create the named objects in the global environment. In my application, I also want to : (a) save each object to a similarly-named .RData file with that object (b) create a corresponding .Rd documentation file. (b) works fine in my loop

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Dennis Murphy
Hi: Hmm, these files look familiar...Lahman database? :) I have the 2010 set, so here's how I got this to work on my system: files <- list.files(pattern = '*.csv') > files [1] "Allstar.csv" "AllstarFull.csv" [3] "Appearances.csv" "AwardsManagers.csv" [5] "AwardsPlayers.csv

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Jean V Adams
Michael Friendly wrote on 09/09/2011 09:39:27 AM: > > I have a collection of .csv files in a directory, and want to read them > into R data.frames whose names > are the same as the file names, without the .csv extension > > e.g., from > > (files <- list.files(pattern="*.csv")) > [1] "Allstar

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 10:39 AM, Michael Friendly wrote: I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from > (files <- list.files(pattern="*.csv")) [1] "Allstar.csv"

[R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from > (files <- list.files(pattern="*.csv")) [1] "Allstar.csv" "AllstarFull.csv" [3] "Appearances.csv" "A