I'm creating a console app with C# in which I have to perform some data analysis using R.NET. I already created multiple R functions that I'll be using and I tested them in RStudio and everything works fine. Suppose that my source file has a function called "delete" that take a vector as parameter.
- Now I want to import the R source file that contains my functions to my Console app to be able to call these functions directly from there.
I found this code:
using RDotNet;
{ ....
REngine engine = REngine.GetInstance();
engine.Evaluate("source('PATH/file.R");
... }
It doesn't get any error, but I'm not sure if it's working. Now if I want to execute my function "delete", what is the command for that?
- The source file is now situated on my desktop, but I want my app to run on any computer, so how can I add my R source file to the VS project to make it portable?