Re: [R] Re ad From EXCEL

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Mon, 21 Apr 2008 14:54:29 -0400

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") mydata[1:10,1:10]

"FromExcel" is not as efficient as it could be, but it works for me every time.

I hope this helps,

Jorge

On Sat, Apr 19, 2008 at 6:06 PM, ermimi <ermimi__at_hotmail.com> 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 you very much.
> --
> View this message in context:
> http://www.nabble.com/Read-From-EXCEL-tp16787900p16787900.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org 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_at_r-project.org 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. Received on Mon 21 Apr 2008 - 19:14:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Apr 2008 - 19:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive