Rcpp11 is an R package shipping a C++11 library facilitating integration between R and C++.
Questions tagged [rcpp11]
49 questions
6
votes
1 answer
#include file not found error
I am attempting to use the Rcpp11 package in r from it's source over at:
devtools::install_github("Rcpp11/Rcpp11")
I read here: http://blog.r-enthusiasts.com/2014/05/27/disambiguating-rcpp11-and-rcpp/
that I can use include + using…

marwin.shaw
- 63
- 5
5
votes
3 answers
Closest point to a path
I have two sets of points, called path and centers. For each point in path, I would like an efficient method for finding the ID of the closest point in centers. I would like to do this in R. Below is a simple reproducible example.
set.seed(1)
n <-…

h.l.m
- 13,015
- 22
- 82
- 169
4
votes
1 answer
Declare a variable as a reference in Rcpp
In C++, we can declare a variable as a reference.
int a = 10;
int& b = a;
If we set b=15, a also changes.
I want to do the similar thing in Rcpp.
List X = obj_from_R["X"];
IntegerVector x_i = X[index];
x_i = value;
I want to update an object from…

user2978524
- 471
- 1
- 3
- 15
4
votes
1 answer
Is there performance difference between NumericVector and vector?
Suppose one uses NumericVector and the other uses vector in their Rcpp code. Is there notable difference between the two usages, especially in performance?

Kun Ren
- 4,715
- 3
- 35
- 50
3
votes
1 answer
RcppArmadillo gamma distribution differs between platforms with same seed
I am working on a package, which uses random numbers from RcppArmadillo. The package runs MCMC algorithms, and to obtain exact reproducibility, the user should be able to set a random number seed. When doing this, it seems like the arma::randg()…

Øystein S
- 536
- 2
- 11
3
votes
2 answers
Rfast installation: /usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed
I am trying to install Rfast package. It gives me the following error,
/usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed
make: *** [Norm.o] Error 1
Full error message is this,
> install.packages("Rfast", dependencies = TRUE)
*…

small_lebowski
- 701
- 7
- 23
3
votes
1 answer
Do I need to specify Rcpp in both Imports and LinkingTo in order to avoid a Makevars file?
According to the Rcpp FAQ (2.15. What about the new ‘no-linking’ feature), since Rcpp version 0.11.0 we can avoid specifying LAPACK/BLAS/Fortran in a Makevars file, and in fact avoid a Makevars entirely if we follow these instructions.
... only two…

evolvedmicrobe
- 2,672
- 2
- 22
- 30
3
votes
0 answers
RCPP - Lost on how to utilize Rcpp::XPtr to wrap a pointer
I am writing an r package that utilizes rcpp.
I have the following class in C++:
using namespace std;
typedef float ffm_float;
typedef double ffm_double;
typedef int ffm_int;
typedef long long ffm_long;
class ffm_model {
public:
ffm_int n;…

ndroz
- 31
- 2
3
votes
1 answer
Calling igraph from within Rcpp
As a part of utilizing network data drawn at random before further processing, I am trying to call a couple of functions from the igraph package at the beginning of each iteration. The code I use is as follows:
#define ARMA_64BIT_WORD
#include…

buzaku
- 361
- 1
- 10
3
votes
1 answer
Building R Package that uses RcppArmadillo, RcppEigen and depends on Cpp11 Plugins
I followed all the procedures explained so far about this matter either in this website or published notes by Dirk, Hadley or others. However, I still have problems in building my package due to the issue regarding cpp11 plugin.
I used…

Amir Nik
- 65
- 8
3
votes
2 answers
Convert a list to a matrix in rcpp
I want to convert a list e.g like this:
[[1]]
[1] 3 4 99 1 222
[[2]]
[1] 1 2 3 4 5
to a matrix (2,5) in Rcpp.
What is the fastest way to do this?
Function wrap() is not working in this case.
First of of I have tried to convert a list to a…

AgnieszkaTomczyk
- 253
- 2
- 12
3
votes
1 answer
Avoid SIGSEGV when subsetting data.frame with call to `[data.frame` in Rcpp
My Rcpp code is occasionally failing (SEGFAULT, etc.) for reasons I don't understand. The code creates a large data.frame, and then tries to obtain a subset of this data.frame by calling the R subset function, [.data.frame), from within the same…

evolvedmicrobe
- 2,672
- 2
- 22
- 30
3
votes
0 answers
Why does LogicalVector to std::vector conversion take so long?
When using Rcpp to interface with external libraries we must convert from
the Rcpp built-in container classes to, most commonly, standard container
classes. This conversion, as always, has a cost. Typically this overhead
is fairly determinate but in…

Thell
- 5,883
- 31
- 55
3
votes
1 answer
RcppArmadillo: failing to install on CentOS
I am trying to install RcppArmadillo on CentOS. Here are some environment details:
OS: CentOS release 6.5 (Final)
R version: R-3.1.2-1.el6.x86_64
uname -sr: Linux 2.6.32-431.29.2.el6.x86_64
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
I have listed…

Mullefa
- 1,237
- 1
- 15
- 27
2
votes
1 answer
RcppParallel no matching function for call to 'transform'
I have a package posted on CRAN which uses multiple cores through the RcppParallel framework. It has the problem being installed on r-devel-linux-x86_64-fedora-clang and r-patched-solaris-x86. I get the following error messages (there are couple of…

Bogdan
- 864
- 10
- 18