Is this the best way to integrate R to Excel ? RExcel package?
In case you wish to read (write) excel spreadsheets into (from) R, you can use the ‘xlsReadWrite’ package.
For further applications and information, you are kindly asked to check the following reference:
There is this : http://en.wikipedia.org/wiki/RExcel
Would you like to import Excel data to R, or from R data to Excel?If you’d like to import Excel to R, you can use the several ways.
http://d.hatena.ne.jp/myopomme/20111208/1323350478 (Sorry, this is Japanese site)
If you’d like to export R data to Excel, Excel can automatically transform the tab separated format to Excel spreadsheet.
So, all you have to do is this code.
write.table(x, file=”hoge.xls”, sep=”t”, …)
* x should be data.frame or matrix.
On the other hand, you’d like to do both. I recommend to use the xlsx package. This package supports the Excel 2007 and old Excel format and very convenient.
http://cran.r-project.org/web/packages/xlsx/index.htmlhttp://d.hatena.ne.jp/myopomme/20110409/1302313511 (Sorry, this is Japanese site)
You need to be clearer. Are you looking to:
a) Write data out from R into Excel. And/or read Excel data into R for processing. (In which case Majeed Simaan and Akira Myomoto’s suggestions are spot-on)
b) Embed R routines within an Excel environment so that the user works in Excel but can get R to programmatically do something in the background return results to Excel, with the user unaware of your actions.
If it’s the latter, then RExcel is the way to go.
Before you ask, I’ve no experience with RExcel!
RExcel is pretty good but is only availble for free on a non comercial license. I’ve recently played around with R.Net, http://rdotnet.codeplex.com/ to write a simple Excel to R link in C# to avoid any licensing issues, http://sharpstatistics.co.uk/csharp/using-r-net-in-an-excel-add-in/.
If you want to have read/ write access- Please use package Rcmdr. Which is flexible.
NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!