rdotnet | NET interop library to call the R statistical language | Script Programming library
kandi X-RAY | rdotnet Summary
kandi X-RAY | rdotnet Summary
.NET interop library to call the R statistical language in the same process
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rdotnet
rdotnet Key Features
rdotnet Examples and Code Snippets
Community Discussions
Trending Discussions on rdotnet
QUESTION
I’m trying to convert a Deedle Frame into an R DataFrame using R.Net.
I tried 3 different approaches:
...ANSWER
Answered 2020-Mar-18 at 15:56CreateDataFrame() wants an array of IEnumerable
, but a1 is an array of seq
, which is F#'s way of saying IEnumerable
; you just need another cast in there. This compiles for me (though I haven't actually run it):
QUESTION
I am using R.NET to generate plots (using ggplot
) and I want to save these graphs in PNG format on disk. Whenever I call engine.Evaluate("ggsave('C:\path\to\file.png', myPlot)")
the program abruptly aborts with exit code 2 without anything being written to disk; no error is displayed when this happens. It is also not possible to write the plot to a file using png()
or pdf()
. This problem is not specific to ggplot
, however - I also cannot store plots generated via the native plot
function.
I could narrow down the problem to the line containing either ggsave()
or png()
/pdf()
: when this line is executed, the program aborts. Since I can actually see the plots generated by both, ggplot()
and plot()
, the plotting itself does not seem to be the issue.
You should be able to recreate what I described using the following C# code:
...ANSWER
Answered 2019-Apr-01 at 11:56Turns out, you cannot have backslashes in the image file's path. If you want to write an image to a file on disk, you have to use forwardslashes, e.g. instead of
QUESTION
I have a question about the sign of t in a paired-sample t-test using different data structures, but the same data. I know that the sign doesn't make a difference in terms of significance, but, it does generally tell the user if there have been decreases over time or increases over time. So, I need to make sure that the code I provide produces the same results OR, is explained correctly.
I have to explain the results (and code) as an example we're giving users of our software, which uses R (Rdotnet within a C# program) for statistics. I'm unclear as to the proper order of variables in both methods in R.
Method 1 uses two matrices
...ANSWER
Answered 2018-Dec-04 at 20:20Since group
is a factor, the t.test will use the first level of that factor as the reference level. By default factor levels are sorted alphabetically to "AFTER" would come before "BEFORE" and "postTest" would be come before "preTest". You can explicitly set reference level of a factor with relevel()
.
QUESTION
I'm using R in a C# webapplication with R.NET. When I add the code below in my webapplication I get following error. But when I run the same code in a console application it works fine. I have no idea why it doesn't work in a webapplication.
Error message:
...ANSWER
Answered 2017-Apr-25 at 13:26I have found an answer to this problem. Add c:\Program Files\r\R-3.2.0\bin\i386 to the Machine or User's PATH environment variable.
QUESTION
I want to transmit R result expression to integer variable using this code :
...ANSWER
Answered 2018-Jan-08 at 15:49Do this:
QUESTION
i'm using c# and R.NET.Community package to run R script from a c# application, i can run any script with no reference to rjava library with the code below but the code below crashed when the script contain the line Library(rJava) and gives me RDotNet.EvaluationException: 'Error: package or namespace load failed for 'rJava', error: unable to load shared object 'C:/Users/..../Documents/R/win-library/3.4/rJava/libs/i386/rJava.dll', i can run the script all right from Rstudio with no errors and correct output, but it gives this error when running it using RDotNet and C#
...ANSWER
Answered 2017-Nov-18 at 19:05The problem was that my script was allocating a lot of memory hence using java (x64) version while my application was running the 32 version of java hence not being able to allocate that memory, all i did was open project properties by right clicking the project then clicking properties and from under build set target to x64.
QUESTION
I am trying to use the R type provider to fit and predict a Support Vector Machines model. I was able to fit the model but when I try to predict the returned vector has the same length as the training vector, which it should not have.
I tried the equivalent code directly in R and the returned list has the correct length.
Why is this happening?
Here is an example:
...ANSWER
Answered 2017-Oct-18 at 15:01I suspect the issue might be when passing parameters to the R.predict
function. I'm not an expert on SVMs, so I'm not sure what is the result this should give, but when I call it as follows, I get results similar to your R version:
QUESTION
I am trying to implement an ICharacterDevice for capturing the full output. I have found some information on this such as:
Implementing an interactive R console in c# / rdotnet?
I am however finding it impossible to find a full example and struggling to get this working on my own. Has anyone done this before with an example?
Many thanks
Mark
...ANSWER
Answered 2017-Aug-31 at 15:24In order to capture the output, you'll need to implement your own ICharacterDevice. Good news is that you only really need to implement the WriteConsole method. You can start with the default ConsoleDevice or start your own from scratch.
QUESTION
I used R.NET to perform Change Point Detection as following
...ANSWER
Answered 2017-Aug-09 at 09:28This property/key of the S4 object is returning an array which contains change points.
QUESTION
We have created a webservice on IIS which calls a R script. The R script includes some libraries like: data.table
, caret and few a more. R is returning an error that it cannot find the data.table
library:
"Error in library(data.table) : there is no package called 'data.table'".
We confirmed that the data.table package is installed in: "C:\Program Files\R\R-3.3.3\library\data.table"
. When we run .libPaths()
to check where R tries to load the libraries from, it returns that this is the folder "C:/Program Files/R/R-3.3.3/library".
It does work successfully in a Visual Studio 2017 unit test or even in a console application environment. So the question is why can't R load the data.table library within IIS?
We using the following software versions:
- R for Windows 3.3.3
- Internet Information Services version 10.0.14393.0
- RDotnet community 1.6.5
C# code:
...ANSWER
Answered 2017-Jun-29 at 07:47We have decided to switch to 'Microsoft R Open' (MRAN) instead of R for Windows (CRAN). This solved a lot of problems for us. We couldn't get CRAN to work with IIS.
Only thing we need to do with MRAN is give the user the IIS application is running on modify access to the library folder at "C:\Program Files\Microsoft\R Open\library". This is needed to enable the R-engine within our application to install R-libraries.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rdotnet
If you need a bit more documentation to get started, the prefered entry point is at http://rdotnet.github.io/rdotnet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page