0

I have a simple CSV file which was created in R using

write.csv(exportChoice, file="exportChoice.csv")

When I read this file using

exportChoice <- read.csv(file = "exportChoice.csv", header=TRUE, row.names=1)

I get the error message:

Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1:
  invalid 'sep' value: must be one byte

but I am certain that I only have a single comma separator.

When I open this CSV file in Microsoft Word, I see that my row and column names are surrounded by quotation marks, for some reason. Could this be the problem with reading the file? How do I solve it?

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • Having quotes around each value is normal; though not required for basic strings, anything with an embedded comma requires quotes around the value to differentiate between a mid-string comma and a field-separating comma. Even with that, having quote marks around values without commas is nothing to worry about, I see it all the time. We are unlikely to be able to help without having a *reproducible question*, please see https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Jan 27 '20 at 16:09
  • Try adding the argument `encoding = "UTF-8"` inside your `read.csv` call. – David Jorquera Jan 27 '20 at 16:11

0 Answers0