Questions tagged [rinside]

RInside is an R package providing C++ classes that simplify the embedding of R in C++ code.

Description

The RInside package provides C++ classes that make it easier to embed R code within C++ code -- on either Linux, OS X or Windows.

Additional Resources

  1. The official CRAN documentation
  2. Package info provided by RDocumentation
  3. A guide explaining the package's usage, written by its creators, can be found here.
109 questions
3
votes
1 answer

Getting Started with RInside C++

I've been an R user for about 4 years and over the past two weeks I've been developing a simple package of functions which analyse some data and plot some graphs in a way suitable for a project other members of my team and supervisor are working on…
SJWard
  • 3,629
  • 5
  • 39
  • 54
3
votes
1 answer

Fatal error: Unable to open the base package

So, now I have managed to compile the hello program of RInside on WindowsXP (VirtualBox). But, when I click on its executable, I get a dialogbox showing the above error. Searching Google led me to this thread where they were talking about the…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
2
votes
0 answers

How to call an R function from an R package in c++, store the result, and use it inside c++ for further processing

I want to load the rpart package in R from inside C++, use the rpart() function in the rpart package to fit a CART model from inside C++, call the result in C++, and store it for further processing. The code that I tried is given below. I am very…
aak201
  • 21
  • 2
2
votes
1 answer

Error while compiling RInside code

I want to compile a R code using RInside. But I am getting errors while using the function read.csv. The code snippet is given below: include "RInside.h" include include include include include…
Manoj
  • 21
  • 1
2
votes
1 answer

Load error calling Rcpp file from R then call back in it

I wrote a R program that calls hello1(), which is an Rcpp function contained in demo2.cpp program library(Rcpp) ssss <- function(dd) { return(paste("hello ",dd)) } sourceCpp(file='demo2.cpp') currentpath <- "/home/xuyan/R/parallel/" aaa…
xuyan
  • 21
  • 2
2
votes
1 answer

Read R console with RInside

I'm using Rcpp and RInside to run some commands into R. I've made a personal GUI (in Qt) which sends commands, and I would like to recover the result in std::string format. Example : $ 1 + 1 The result is : [1] 2 And I want to have this string…
C. Dupont
  • 21
  • 2
2
votes
0 answers

Rinside compilation error with kdb

I sucessfully ran the sample codes in the package. Then I copied code from sample1 into another file of mine and set it up to compile using Makefile. Also copied sample copies into the same directory. The samples in the directory compile and run…
Naveen Sharma
  • 1,057
  • 12
  • 32
2
votes
2 answers

RInside example build using clang++ on OS X Mavericks cannot find STL standard library on linking

I recently moved to C++11 and Xcode 5 with command line tools on OS X 10.9.1, installed boost 1.55 using Homebrew and changed the compiler from g++ to clang++ (as mentioned in this post: Error when with Xcode 5.0 and Rcpp). The compiler change fixed…
crogg01
  • 2,446
  • 15
  • 35
2
votes
1 answer

Using RInside destructor

A simple experiment shows that only one RInside instance is allowed per thread at a time. #include int main() { RInside R1; R1.parseEval("cat('Hello, R1\n')"); RInside R2; R2.parseEval("cat('Hello, R2\n')"); return 0; } The…
1
vote
1 answer

call R function directly from R script in Qt

I would like to know if I could call R function already created in R script inside Qt push button. As Qt is based on C++ language. I know that I can use "RInside" and "Rcpp" libraries to run R inside C++ code. However, this require changing the R…
majed
  • 33
  • 4
1
vote
3 answers

g++ ld can't find RInside symbols for x86_64 architecture

I get a linker error saying that symbol(s) cannot be found when I try to compile an RInside sample file with g++. Any assistance would be appreciated. R version 2.13.1 is installed on Mac OS X 10.5. Rcpp and RInside include files have been copied…
Aperium
  • 66
  • 7
1
vote
1 answer

mvrnorm & riwish

I would like to sample from a multivariate normal and inverse-wishart distribution. I know R has mvrnorm (MASS) and riwish (MCMCpack). Is it possible through RInside to use those functions?
Sylver
  • 11
  • 1
1
vote
0 answers

Reuse RStudio environment with RInside

Background/what I've tried: My end goal is to be able to dispatch some C++ code (a rather large physics-simulation application) from RStudio and while that C++ code is running have it repeatedly talk to an embedded R instance in order to make…
Jay
  • 93
  • 6
1
vote
1 answer

RInside: parseEvalQ 'Parse Error' causes each subsequent call to parseEvalQ to give a 'Parse Error' even if exception handled

My code, which tries to emulate an R shell via C++, allows a user to send R commands over a tcp connection which are then passed to the R instance through the RInside::parseEvalQ function, during runtime. I have to be able to handle badly formatted…
C Noble
  • 11
  • 2
1
vote
1 answer

Configure RInside with Veins and OMNET++ on Windows

I have been trying to configure RInside with Veins and OMNET++, but finding some issues. After going through the discussion in Is it possible to use RInside in omnet++/Veins project to benefit from rich R features and How to set up Eclipse +…
user8561039
  • 115
  • 10