I took the mtcars data set from MASS and made a few modifications. After going from one package to another I finally got the data into notepad where I carefully made sure that spaces were the delimiter. My problem is that the file thus created will not read in. I have a test file which reads in just fine.
Can you explain what the error message is telling me? Thank you. Error messages and code used is given below.
TEST.txt
120 140 7.5
140 150 8.5
mtcars2=read.table(file="TEST.txt",header=FALSE)
mtcars2
# V1 V2 V3
# 1 120 140 7.5
# 2 140 150 8.5 OK
mtcars2.txt problem dataset
160 110 2.62
160 110 2.875
160 110 2.32
160 110 3.215
160 115 3.44
mtcars2=read.table("c:\\data\\mtcars2.txt",header=FALSE)
Warning messages: 1: In read.table("c:\data\mtcars2.txt", header = FALSE) : line 1 appears to contain embedded nulls ... 6: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : embedded nul(s) found in input NOT OK
I also tried the following:
mtcars2=read.table("c:\\data\\mtcars2.txt",fill=T,header=FALSE)
mtcars2.txt
onto notepad and saved, then used yourread.table...
above and it more or less worked for me. I would go and see if you have any whitespace behind each of your lines the.txt.
files. – Bryan Gogginread.table
. – alistaire