writing VBA code to call R script - r

I've downloaded and installed Rconn as well as Rexcel. The API appears to be working as I am able to copy my code from R into Excel and then, through the use of the API GUI I am able to extract values for one of my matrices.
The problem I'm having is within VBA. When I try and run the following line:
RInterface.StartRServer
I get the following error message: "Run-time error'424': Object required"
Would anyone be able to help me understand why I'm getting this error? Am I perhaps meant to load something from "Tools/References"?
Any help would be greatly appreciated
Thanks
Mike

I managed to sort it out. It was a reference problem. Once the rconn and RExcel are install you have to go to tools>References>RExcelVBAlib.
This will then allow you to use RExcel within VBA

Related

How can I run R script with Jython?

I want to run my R code through Jython. I have not used Jython before. Can anyone of you please tell me how can I do? Can rJython help me to do so?

Unexpected token in R with chunks

i started a new R Project and everytime I use chunks (regardless from the topic within) the task went trough but i receive an "unexpected token '`" and a red dot in the referring line (see picture)chunks unexpected token R.
Also, when my script crushes and/or is reopened all my chunks are gone until I renamed the script.
What am I doing wrong?
Thanks in advance for your help
(R version is 4.1.2. "Bird Hippie")
I found the solution,
due to a complete R update I had to install the "rmarkdown" (again).
Afterwards (and a run through the code) everything worked out well.
Maybe this issue might be interesting for others too, so I will keep it here :) .

Why do I get error messages when trying to save or exit from Rstudio?

I deal with a problem in R Studio. When I choose to save my work, this message shows up
And if I try to close the program, this message shows up
Any ideas why this happens? Also, I would like to ask if it is better to use the latest version of R (R4.0.2)?
Thank you for your answers. The problem was that I had open an R script file which I had deleted before. When I remove this script, Rstudio works fine.

Rstudio outputs an error into the console while editing script

I am working on a project on Rstudio and something wired has become to happen: each time I write something into a script Rstudio automatically writes the following error into the console:
Error in rep.int(vectorNames[i], length(vector[[i]])) :
unimplemented type 'NULL' in 'rep3'
and a label appears under the cursor: "R code execution error".
Appart form this visual bug, everything is working properly. Does anyone have the same issue ?
I've just experienced this issue. In my case, I guess it must be related to the NAMESPACE file from the package.
I can see a discussion about this subject here on R Studio support site.
Citation from the source mentioned above:
There are two times when we run the code that could be emitting this error:
When attempting to retrieve completions from the package's NAMESPACE file,
When attempting to retrieve completions for native routines (e.g. for within a '.Call()' call).
Can you recall if you had been editing the package's NAMESPACE file before seeing this error? Alternatively, have you been using 'devtools::load_all()' or other similar machinery?
And to clearly answer your question:
Yes! I am having the same issue! (Damn it! :) )
LATER EDIT:
I've got rid of the problem by closing the project and reopening it again.

R (beginner) : Using R functions in excel (RExcel)

I have coded a project in R and I would like to export my functions to R.
Is there an add-in or any other way enabling such functionality ?
Edit
After Dabbiemiller's answer I followed the installation procedure and I successfully installed rcom and RExcel. However I am not able to use it. I have the following error message when trying to start RExcel in Excel 2010:
There seems to be no R process connected to Excel
Could someone help me with this latest problem please?
Many thanks
From my first google search, here's a try : http://rcom.univie.ac.at/download.html#RExcel.
Good Luck.

Resources