How to convert R variable to Excel variable & vice versa

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to convert R variable to Excel variable & vice versa

puspendra
Hi
  I want to know some code about Rexcel. Please if you can respond, it will be great helpful for me. Problem is that the conversion of Excel (type of) variable to R (type of) variable. Suppose I have written the code in VBA.
 
Option Base 1
Sub test()
Dim x(5) As Integer
x(1) = 10
x(2) = 20
x(3) = 30
x(4) = 40
x(5) = 50

RInterface.StartRServer
   
RInterface.RRun "Nt<- x[3]"                       'I want to store 3rd element of an array by using R
                                                            '& also if possible I want to show this value by msgbox
RInterface.StopRServer
End Sub
 
I think x() array is an Excel type and we will have to convert it to R type of array i.e. vector. The question is How?
and again I want to perform some action on 'Nt' through excel VBA, then again we will have to convert this R type of Variable to Excel type.
Am i right?
Please suggest me some way how to do these things.
Reply | Threaded
Open this post in threaded view
|

Re: How to convert R variable to Excel variable & vice versa

Ryusuke
I would like to convert some codes from R to Excel as well, anyone can help????
[url=http://scientific.oksport.cn][color=Blue]体育统计学社区[/color][/url] [url=http://www.188bet.com/en-gb/?affiliateCode=79512&referralUrl=aff.188bet.com][color=Blue]金宝博[/color][/url]
Reply | Threaded
Open this post in threaded view
|

Re: How to convert R variable to Excel variable & vice versa

puspendra
Please find the attached document, perhaps it might help..............
RExcel.doc