[R] Help - Importing data from txt and xlsx files

MacQueen, Don macqueen1 at llnl.gov
Fri Apr 13 20:58:47 CEST 2012


Have you correctly set the value of the 'sep' argument to read.table?

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 4/13/12 7:28 AM, "AMFTom" <the.quiet.room at gmail.com> wrote:

>Dear Thierry, 
>
>Thanks for your help. Now though, I try to import data from a txt file,
>and
>it says either 
>
>> mydataframe <- read.table("Lv2.8.txt")
>Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
>na.strings, 
>: 
>  line 3 did not have 15 elements
>
>or
>
>> mydataframe <- read.table("Lv2.8.txt", header = TRUE)
>Error in read.table("Lv2.8.txt", header = TRUE) :
>  more columns than column names
>
>even though I seem to have put a column name into the txt file for each
>column. Any ideas?
>
>Thanks again!
>
>Tom
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/Help-Importing-data-from-txt-and-xlsx-files-
>tp4554622p4555001.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list