Skip to content
Prev 247602 / 398503 Next

Importing multiple text files with lapply.

Hi Jim, 
Ultimately, I'm going to want to count the frequency of dates by particular time periods (months, quarters, years) for each state and then plot the data. I know there are commands in ggplots that will do that, so I'm not too worried about that, but I was stuck on getting 50 text files (one for each state) read into R.  For the record, using read.table individually on a state file will get in a useable format, but wasn't working in conjunction with lapply.
To reiterate, the home file has 50 .txt files each with a column of dates in the format I sent you.  
I will try readLines and see if I can get it to loop through.
Yours, Simon Kiss
On 2011-01-17, at 7:44 PM, jim holtman wrote:

            
*********************************
Simon J. Kiss, PhD
Assistant Professor, Wilfrid Laurier University
73 George Street
Brantford, Ontario, Canada
N3T 2C9
Cell: +1 519 761 7606