I'm trying to upload a GSS data set into R Markdown for creating a lecture presentation.
Each time I do, I get errors that I do not understand. Any help would be appreciated.
read.csv("directory/GSS2018.xls", headers = TRUE)
Error in read.table(file = file, header = header, sep = sep, quote = quote, : unused argument (headers = TRUE)
My .xls has headers, so I'm not sure why it is saying "untrue". Even still, I tried taking out the headers option and received this:
read.csv("~directory/GSS2018.xls")
line 1 appears to contain embedded nullsline 2 appears to contain embedded nullsline 3 appears to contain embedded nullsline 4 appears to contain embedded nullsline 5 appears to contain embedded nullsError in make.names(col.names, unique = TRUE) : invalid multibyte string at '<1a>'
I can't quite get what this error is telling me, nor how to fix it. I can import my data just fine using the "Import Dataset" button on the environment sector of R Studio - but when I put that code into R markdown, it shows up all these errors.
Any help is appreciated!