[R] gtools(read.xls) error in perl installation?

Ashish Ranpura buddhahead at ranpura.com
Wed Oct 25 20:10:12 CEST 2006


My installation is R version 2.4.0 on Mac OS X version 10.4.8 (the  
latest release in both cases). I've recently had to restore my hard  
drive after a crash, and fear that this may have screwed up my Perl  
installation slightly.

Whenever I run the read.xls function from library(gtools) I get the  
following errors:

######################
 > file = "~/Desktop/my_excel_file.xls"
 > read.xls(file)

Error in file(file, "r") : unable to open connection
In addition: Warning message:
cannot open file '/tmp/Rtmp6QRggx/file10d63af1.csv', reason 'No such  
file or directory'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LC_ALL = (unset),
	LANG = "en_US_POSIX.UTF-8"
     are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Unable to open file '~/Desktop/2006_ICN_subjects.xls'.
######################

On the other hand, if I use the example in the help file...

######################
 > xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls')
 > read.xls(xlsfile)

perl: warning: Setting locale failed.
    Sepal.Length Sepal.Width Petal.Length Petal.Width  
Species           X
1             1         5.1          3.5         1.4     0.2     setosa
2             2         4.9          3.0         1.4     0.2     setosa
...
61           62         5.9          3.0         4.2     1.5 versicolor
62           63         6.0          2.2         4.0     1.0 versicolor
perl: warning: Please check that your locale settings:
	LC_ALL = (unset),
	LANG = "en_US_POSIX.UTF-8"
     are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
######################

To summarize, I can retrieve data from the example file, but I get  
the Perl warning. I can't retrieve data from any of my own Excel  
files. I've tried a number of locale solutions (locale -a doesn't  
list en_US_POSIX.UTF-8, but Sys.setlocale(LC_ALL = "C") doesn't  
help). Any suggestions would be appreciated.

Thanks,

-Ashish Ranpura.


-----
Ashish Ranpura
Institute of Cognitive Neuroscience
University College London
17 Queen Square
London WC1N 3AR

tel: +44 (20) 7679 1126
web: http://www.icn.ucl.ac.uk



More information about the R-help mailing list