Reputation: 43
I having a problem separating a csv file that interprets mutiple row inputs as:
[1] "bizname,addr,bizphone,numrevs" "Jersey Smoke,\""
[3] " 84 N Main St, Milltown, NJ 08850" " \",\""
[5] " (732) 253-7977" " \",\""
The first string is the headers within the file. Now the problem is that there is additional quotation marks within the data, and if I try to split the data based on the quotation marks using something like this:
vapeshopsnj1 <- read.csv("~/Desktop/newjerseyvapeshopsA.csv",
row.names = NULL, sep="\"", header = TRUE,
colClasses= "character", encoding= "utf-8")
There is an error that is produced which is:
Error in read.table(file = file, header = header, sep = sep, quote = quote,: more columns than column names
Upvotes: 2
Views: 412
Reputation: 43
After two hours of google-ing and reading various stack-exchange posts, and R resources I have found the answer. If this saves you two hours one day, you can thank this post:
vapeshopsnj1 <- read.csv("~/Desktop/newjerseyvapeshopsA.csv", row.names = NULL, quote = "\"", header = TRUE, colClasses= "character", encoding= "utf-8")
Upvotes: 1