[R] question

Marc Schwartz MSchwartz at medanalytics.com
Sun Feb 23 02:14:03 CET 2003

Andrew C. Ward wrote:
> 1. The easiest way may be to save the file as a delimited file (CSV
> works well) and then read it into R (using read.csv, read.delim,
> etc). A DCOM server does exist for R (see CRAN), but I don't have any
> experience with it. I know that others use it successfully.
> 2. You will need to give the exact error message if you want a more
> specific advice. Perhaps R cannot find the file.
> Regards,
> Andrew C. Ward
> CAPE Centre Department of Chemical Engineering The University of
> Queensland Brisbane Qld 4072 Australia andreww at cheque.uq.edu.au
> Quoting Nicoleris Theodoros <nikthe at aegean.gr>:
>> Iam a novice R-user and I have a few questions: 1) How can R import
>> an Excell data file?
>> 2) I have a file.s file which it seems I can open but I can not
>> load it i.e. when I write the file name in the command line, for
>> e.g.
>>> file.s it gives me an error message
>> thank you for your consideration, Theo Nicoleris

In follow up to Andrew and Prof Ripley on your second question, one
thought comes to mind on the file load issue. That is to be sure that
you have properly specified the file's pathname when loading it.

I am presuming that you are under Windows.

Be sure to use either Linux/Unix-like pathnames using the "/" separator
or use a Windows-like double "\\" in the path. Also be sure to use
double quotes around the full file/pathname.

Thus, within Rgui if you use source(), use something like:

source("C:/My Documents/file.s")


source("C:\\My Documents\\file.s")

If you are using Rterm from a Windows command line use something like:

Rterm.exe --no-restore --no-save < "C:/My Documents/file.s" > R.out


Rterm.exe --no-restore --no-save < "C:\\My Documents\\file.s" > R.out

In both cases, of course adjust the file/pathname accordingly. On the
command line, spaces in the pathname as with "My Documents" will cause
problems since the text on either side of the blanks will be treated as
separate command line arguments, not as a single filename. Thus
surrounding the full path/filename with double quotes will help.

BTW, this is covered in the R Windows FAQ at



2.13 R can't find my file, but I know it is there!

Hope that might help,

Marc Schwartz

More information about the R-help mailing list