First, I'd like to say I'm pretty new to this whole thing. I've been learning R through my econometrics classes and have constantly been met with the same problem.
When I try to read data into r using read.table or read.csv I always get weird errors. The two most common are that line 1 or 2 contain embedded nulls and that there is an incomplete line somewhere. I want to be clear that this happens on almost every single data set I download. These datasets are all from textbooks (econometrics), or from Coursera classes(namely the John Hopkins Data Science one) so they should be ok. I've also watched my professors import with 0 problems.
Edit:
Here's the full error message
data <- read.table(file.choose(), header= TRUE) Warning messages: 1:
In read.table(file.choose(), header = TRUE) : line 1 appears to
contain embedded nulls 2: In read.table(file.choose(), header = TRUE)
: incomplete final line found by readTableHeader on
'C:Users..DesktopData setsProject-11-datafile.xlsx'
I've tried changing the encoding to a few options, using the skipNul
command, as well as a few other things I've found here or there. It happens on EVERY dataset so I feel like I did something wrong somewhere
Did I change something or mess something up on the install? Could it be a problem with excel? I've searched everything, tried changing encoding options and it still persists.
The most recent one was here:
https://www.core-econ.org/doing-economics/book/text/11-03.html#part-111-summarizing-the-data
And I cannot even import due to the warning messages(just using read.table(file.choose(), header= TRUE)
I'm sorry for such a stupid question and I don't know what more details would be useful, but this is driving me absolutely crazy.
Also if it helps I'm on windows 10 and have the Korean language set as the default, if that even matters.
Thanks in advance for anyone taking the time to try and help
question from:
https://stackoverflow.com/questions/65935652/constant-errors-when-reading-data-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…