[R] Cannot read in a csv file.

John Kane jrkrideau at yahoo.ca
Sat May 7 19:26:18 CEST 2011


Can anyone suggest why this file  http://www.mediafire.com/?afeyhhpacaq
is refusing to open for me.? 

I must admit I don't know all its history but the original data was taken from an OOo spreadsheet that I edited (good bit of copying and pasting and the month variable added by hand in OOo Calc) and, then,saved as a csv file.  It was not originally an English language file as far as I can determine.  It may have been created in Excel for all I know. 

If I load the file into my text editor (Tinn-r) I can read the material in using the textConnection command and have no problem working with it.  However this meant that I spend an hour and a half trying to read the file and 5 minutes doing the graph I wanted.  I'd like to avoid my mistake in the future if possible.

I'm showing my last try below but the directory is almost certainly correct. I've tried it  using a full path name and, as below, after changing the active directory.

When I try to load the file  I get this:

> read.csv("asp.csv", header=TRUE, sep=",") 
 
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : cannot open file 'asp.csv': No such file or directory

sessionInfo()

R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252   
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C                   
[5] LC_TIME=English_Canada.1252    

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_0.8.9 proto_0.3-9.1 reshape_0.8.4 plyr_1.4.1   

loaded via a namespace (and not attached):
[1] digest_0.4.2 tools_2.12.2
> 

Thanks.



More information about the R-help mailing list