R invalid input found on input connection (windows only)
A similar question has been posted here some time ago but left unresolved
I am trying to load a csv data set into R. On a windows machine I get the
following:
> part2 <- read.table("csv2.csv",sep=";",dec=",",quote="\"",
fileEncoding="CP866")
Warning messages:
1: In read.table("csv2.csv", sep = ";", dec = ",", quote = "\"",
fileEncoding = "CP866") :
invalid input found on input connection 'csv2.csv'
2: In read.table("csv2.csv", sep = ";", dec = ",", quote = "\"",
fileEncoding = "CP866") :
incomplete final line found by readTableHeader on 'csv2.csv'
> edit(part2)
V1
1 RM-E
It does not read the whole table, just the first couple of characters and
then stops.I can read the whole table IF I leave out the fileEncoding
parameter. But then the text will be garbled. The file's encoding is OEM
866 and can be read correctly in Excel and Notepad++.
Yet on a Linux machine - RStudio on Amazon's EC2 - the exact same command
reads the entire document correctly with no errors. Changing the windows
locale doesnt do anything.
Can anyone tell what it is about R on windows that produces this error. Is
there a way out, besides using linux?
Thanks!
No comments:
Post a Comment