[R] A question in R

Sundar Dorai-Raj sundar.dorai-raj at PDF.COM
Tue Oct 12 17:56:58 CEST 2004



Yayira har wrote:

> I started to learn the R language, but I didn't suceed to use an external file.
>  
> Let say that I have an excel file called "test1.xls" in the directory 
> "C:/program files/R/rw2000/external_files" that looks like that:
>  
> name  mark
>   yair      80
>  yosi      70  ...
>  
> In the appropriate directory I wrote this:
>  
> x<-read.delim("test1.xls")
>  
> or this:
>  
> x<-read.csv("test1.xls")
>  
> but I got:
>  
> [1] X......
> <0 rows> (or 0-length row.names)
>  
> way cannot I read the file? what is the appropriate command for reading an excel file?
> 
> I looked at the site of R-project but I didn't find a suitable comand.
> 

Is the file an Excel file (probably from the extension) or can you open 
the file in notepad and read the text? If not, you need to save the file 
as csv or txt from within Excel and import the file into R as you tried 
above. You may also want to read the "R Data Import/Export" manual which 
is available from the r-project.org website.

--sundar




More information about the R-help mailing list