ermimi wrote:
Hello!!!
I have been read a much about as read data from Excel File, but I haven´t
found the necesary information to read the data.
Now, I can create a channel : channel - odbcConnectExcel(file.xls) but I
don´t know as read the data??
I hope that you could help me. Thank
these difficulties?
-- Bert Gunter
Genentech Nonclinical Statistics
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Erich Neuwirth
Sent: Sunday, April 20, 2008 2:18 AM
To: r-help@r-project.org
Subject: Re: [R] Re ad From EXCEL
To transfer data from Excel to R
)
#close channel
#data now stored in Dates.data
Joe
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ermimi
Sent: Saturday, April 19, 2008 5:06 PM
To: r-help@r-project.org
Subject: [R] Re ad From EXCEL
Hi there,
Try this:
# Function to read data in R from Excel
FromExcel=function(yourfile,spreadsheet){
require(RODBC)
channel=odbcConnectExcel(yourfile)
sqlTables(channel)
mydata=sqlFetch(channel, spreadsheet)
attach(mydata)
mydata
}
mydata=FromExcel(C:/mydata/2008/yourfile.xls,yourspreadsheet)
To transfer data from Excel to R you have a least 3 options.
RODBC is platform-independent. You can use it to read Excel files
on any platform where you have an ODBC driver for Excel installed.
xlsReadWrite is available only on Windows. It has a function read.xls
which reads data from Excel
Thank you Erich for you information, I will continue investigating about as
read data from excel.
Erich Neuwirth wrote:
To transfer data from Excel to R you have a least 3 options.
RODBC is platform-independent. You can use it to read Excel files
on any platform where you have an ODBC
Hi
there is also a direct copy option
In Excel select a portion of data you want to copy, preferably with header
and press Ctrl-C
Open R
issue
read.delim(clipboard)
For inverse transfer see
?write
Regards
Petr
[EMAIL PROTECTED]
[EMAIL PROTECTED] napsal dne 20.04.2008 17:51:26:
Thank
Hello!!!
I have been read a much about as read data from Excel File, but I haven´t
found the necesary information to read the data.
Now, I can create a channel : channel - odbcConnectExcel(file.xls) but I
don´t know as read the data??
I hope that you could help me. Thank you very much.
--
8 matches
Mail list logo