[R] Importing multiple text files with lapply.
jholtman at gmail.com
Mon Jan 17 20:02:38 CET 2011
mylist <- lapply(a, read.table, header = TRUE, sep = '\n')
also is the separator really '\n' meaning a new-line? What exactly
does the data look like?
On Mon, Jan 17, 2011 at 11:47 AM, Simon Kiss <simonjkiss at yahoo.ca> wrote:
> I'm trying to read in 50 text filess with dates as content to create a list of tables.
> a is the list of filenames that need to be read in.
> The following command returns the following error
> mylist<-lapply(a, read.table(header=TRUE, sep="\n"))
> Error in read.table(header = TRUE, sep = "\n") :
> element 1 is empty;
> the part of the args list of 'is.character' being evaluated was:
> Does anyone have any suggestions?
> Yours, Simon Kiss
> Simon J. Kiss, PhD
> Assistant Professor, Wilfrid Laurier University
> 73 George Street
> Brantford, Ontario, Canada
> N3T 2C9
> Cell: +1 519 761 7606
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Data Munger Guru
What is the problem that you are trying to solve?
More information about the R-help