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

2012-04-16 Thread AMFTom
Hi all, it turns out I had left absent data as a blank space instead of filling it with a zero. Now I am able to import data. Thanks for all your help, I'm sure I will be calling on your expertise in future. Tom -- View this message in context: http://r.789695.n4.nabble.com/Help-Importing-data

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

2012-04-13 Thread steven mosher
read your file with readLines(). copy the first few lines for me to read here test <- readLines(yur filename) test[1:5] post the result. we can figure it out from there On Apr 13, 2012 11:46 AM, "AMFTom" wrote: > Dear Thierry, > > Thanks for your help. Now though, I try to import data from a tx

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

2012-04-13 Thread MacQueen, Don
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" wrote: >Dear Thierry, > >Thanks for your help. Now though, I try to impor

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

2012-04-13 Thread jim holtman
This is a case where you need to provide a sample of your data. Most likely it is not in a format that read.table can read with the parameters you have given it. It may have different field separators, it might have "#" in data fields, you might have unbalanced quotes, etc. So it is a problem in

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

2012-04-13 Thread AMFTom
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("Lv

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

2012-04-13 Thread ONKELINX, Thierry
[R] Help - Importing data from txt and xlsx files Hi all, I have just started to use R for my PhD project and have no previous experience in programming. I am having trouble importing data to R. This is the output: > mydata <- read.table("Lv2.8.txt") Error in file(file,

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

2012-04-13 Thread AMFTom
Hi all, I have just started to use R for my PhD project and have no previous experience in programming. I am having trouble importing data to R. This is the output: > mydata <- read.table("Lv2.8.txt") Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(