Re: [R] R-excel

2007-08-11 Thread Prof Brian Ripley

On Fri, 10 Aug 2007, Peter Wickham wrote:


I am running R 2.5.1 using Mac OSX 10.4.10. xlsReadWrite is a Windows
binary. Instead, install and load packages: (1) gtools:(2) gdata. These
are both Windows and Mac binaries. gdata depends on gtools, so be sure
to load gtools first or set the installation depends parameters. Then you


The R default *is* to install dependencies in R = 2.5.0.


can use read.xls.  Thus, in Mac: data-read.xls(/Users/your
name/Documents/data.xls,sheet=1). For Windows, substitute the appropriate
filepath and file name in the first argument of read.xls: e.g.,
data-read.xls(A:/filename.xls,sheet-1). Thanks to correspondents for


You mean sheet=1 

There are other platforms, and the usage of gdata::read.xls is common to 
all platforms.



their advice; but I hope that this may alleviate some of the frustration
(referred to in the R Import/Export Manual) associated with dealing with


That is described in the 'R Data Import/Export Manual' (sic).

It *increases* the frustration of those who WTFM to see it and its 
contents misdescribed in this way.  Further, people who search the list 
archives are liable to make use of buggy posts like this one, so it seems 
necessary to put the corrections and frustration on the record.


Please just point people to the appropriate manual



EXCEL files in R.

Erika Frigo wrote:



Good morning to everybody,
I have a problem : how can I import excel files in R???

thank you very much


Dr.sa. Erika Frigo
Università degli Studi di Milano
Facoltà di Medicina Veterinaria
Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
Alimentare (VSA)

Via Grasselli, 7
20137 Milano
Tel. 02/50318515
Fax 02/50318501
[[alternative HTML version deleted]]


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-08-10 Thread Peter Wickham

I am running R 2.5.1 using Mac OSX 10.4.10. xlsReadWrite is a Windows
binary. Instead, install and load packages: (1) gtools:(2) gdata. These
are both Windows and Mac binaries. gdata depends on gtools, so be sure
to load gtools first or set the installation depends parameters. Then you
can use read.xls.  Thus, in Mac: data-read.xls(/Users/your
name/Documents/data.xls,sheet=1). For Windows, substitute the appropriate
filepath and file name in the first argument of read.xls: e.g.,
data-read.xls(A:/filename.xls,sheet-1). Thanks to correspondents for
their advice; but I hope that this may alleviate some of the frustration
(referred to in the R Import/Export Manual) associated with dealing with
EXCEL files in R.

Erika Frigo wrote:
 
 
 Good morning to everybody,
 I have a problem : how can I import excel files in R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
 Alimentare (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/R-excel-tf3975982.html#a12101349
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Christophe Pallier
cf. R Data Import/Export
file:///tmp/RtmpnFqONj/.R/doc/manual/R-data.htmlin the standard
documentation.

Christophe

On 6/25/07, Erika Frigo [EMAIL PROTECTED] wrote:


 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
 Alimentare (VSA)

 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
 [[alternative HTML version deleted]]


 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Christophe Pallier (http://www.pallier.org)

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Stefan Grosse
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets

plus there is a package xlsReadWrite that might be of your interest.

Stefan

 Original Message  
Subject: [R] R-excel
From: Erika Frigo [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Date: 25.06.2007 14:47
 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]

   
 

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
   
 

 No virus found in this incoming message.
 Checked by AVG Free Edition. 
 Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date: 24.06.2007 
 08:33


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Sébastien
Hi,

Directly import from Excel files should be possible using the RODBC 
package. Yu may want to read the R data import/export manual about the 
RODBC package for further details.
Another solution is to save each of your Excel sheets as *.csv file and 
import the data in R using the read.table command (see ?read.table).

Sebastien

Erika Frigo a écrit :
 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]

   
 

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
   

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Moshe Olshansky
Also try xlsReadWrite package on CRAN.

--- Erika Frigo [EMAIL PROTECTED] wrote:

 
 Good morning to everybody,
 I have a problem : how can I import excel files in
 R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per
 la Sicurezza Alimentare (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
  __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Erich Neuwirth
The R(D)COM server (contaiong the RExcel Excel addin) and/or the rcom
package allow (among other things) to select a range in Excel and
directly transfer it to R as an array or as a dataframe.
It only works on Windows with Excel and R installed.

More information on these packages is available at

http://rcom.univie.ac.at


Erika Frigo wrote:
 Good morning to everybody,
 I have a problem : how can I import excel files in R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
 
 
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Erich Neuwirth, Didactic Center for Computer Science
University of Vienna
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-9394

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Stephen Tucker
There are also some notes about this in the R Data Import/Export manual: 
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets

But I've gathered the following examples from the R-help mailing list
archives [in addition to the option of saving the spreadsheet as a .csv file
and reading it in with read.csv()]. Personally, I use option 4 regularly (I
happened to have Perl installed on my Windows XP machine already) and have
had good luck with it.

Hope this helps.

= Option 1 =
# SIMPLEST OPTION
install.packages(xlsReadWrite)
library(xlsReadWrite)
data = read.xls(sampledata.xls,sheet=1)

= Option 2 =
# ALSO SIMPLE BUT MORE MANUAL WORK EACH TIME
# (1) highlight region in Excel you want to import and
data = read.delim(file=clipboard,header=TRUE)
# or, if you don't have a header,
data = read.delim(file=clipboard,header=FALSE)

= Option 3 =
# RODBC IS A BIG APPLICATION, FOR INTERFACING
# WITH MANY TYPES OF FILES/SERVERS
install.packages(RODBC)
library(RODBC)
fid - odbcConnectExcel(sampledata.xls)
data - sqlFetch(fid,Sheet1)
close(fid)

= Option 4 =
# REQUIRES CONCURRENT INSTALLATION OF PERL
install.packages(gdata)
library(gdata)
data = read.xls(sampledata.xls,sheet=1)

 



--- Erika Frigo [EMAIL PROTECTED] wrote:

 
 Good morning to everybody,
 I have a problem : how can I import excel files in R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
 Alimentare (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
  __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 



   


Comedy with an Edge to see what's on, when.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.