0

I am not able to read a csv file in R. The file I imported need some cleaning such as removing text qualifiers such ",' etc. Still I am unable to read it. shows the following error.

currency<-read.csv("02prepared data/scraped data kickstarter/film & video1.csv")

Error in type.convert(data[[i]], as.is = as.is[i], dec = dec, numerals = numerals, : invalid multibyte string at '45,<30>97'

here is the link to the file:- https://drive.google.com/open?id=1ABXPoYxk8b4WCQuRAu-Hhh2OvpJ76PhH

neilfws
  • 26,280
  • 5
  • 44
  • 53
  • 1
    Cannot reproduce on my machine (R 3.4.4, Windows 10); `read.csv` worked fine. Could be the pound symbols causing the issue. – neilfws Apr 18 '18 at 23:04
  • I have 10 similar files. 9 of which could be read correctly with had pound symbol in it. This is the only one with which I am unable to read the csv. The pound symbol is surely not an issue @neilfws – Dishant Shetty Apr 18 '18 at 23:10
  • try the answers from here: https://stackoverflow.com/questions/14363085/invalid-multibyte-string-in-read-csv – GordonShumway Apr 18 '18 at 23:14
  • I followed the instructions [here](https://stackoverflow.com/questions/4806823/how-to-detect-the-right-encoding-for-read-csv) to come up with: `g – Ben Bolker Apr 18 '18 at 23:15
  • @BenBolker tried using fileEncoding="1046" ,it combined the data when I viewed it in Excel. fileEncoding="latin1" worked perfectly. Thank you anyways. – Dishant Shetty Apr 18 '18 at 23:37

1 Answers1

1

You can try setting fileEncoding = 'latin1', as suggested in this answer: https://stackoverflow.com/a/14363274/6304113

I tried the method in the link to read your file, and it works for me.