Skip to content

EXCEL FILE

5 messages · Ulises M. Alvarez, Cesar Ortega, Peter Dalgaard +1 more

#
Hi!

Take a look at 'read.table' which will aloow you to import your excell 
file as a data frame. Then, you'll be able to easily construct your 
vectors.

Regards.
On Thu, 8 May 2003, Cesar Ortega wrote:

            

  
    
#
Hi gruop,



Pardon my question, but how could I import a excel file with 2 columns 
to R and then work with them as vecors.

Thanks in advance,
#
Use 'save as' in excel to create 'foo.csv' and then

read.csv(file='foo.csv',sep',',header=T)

(use header=T only if first row has labels, and you may need to include 
a path with your filename)

cheers,
Joel
cortega at unitec.edu wrote:

  
    
#
Joel Kincaid <jfkincaidsu at netscape.net> writes:
Those are the defaults... read.csv(file='foo.csv') should do. Use
header=FALSE if the header is absent. Notice also that in some
locales, CSV files have "," for decimal separator and ";" for the
value. That's where read.csv2 is relevant.
#
Peter Dalgaard BSA wrote:
This will save me some typing...
and also I goofed with the orginal specification:
 > Joel Kincaid <jfkincaidsu at netscape.net> writes:
 >
 >
 >>Use 'save as' in excel to create 'foo.csv' and then
 >>
 >>read.csv(file='foo.csv',sep',',header=T)
                ^^^^^                       Should have (unnecessarily :) written "sep=','" rather 
than the
syntax error inducing "sep','"      

Cheers, Joel