Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
48 views

I am running a straightforward parallelized computation using RcppEigen and OpenMP. Here is a minimal reproducible example of the code: // [[Rcpp::depends(RcppEigen)]] // [[Rcpp::plugins(openmp)]] #...
Ari.stat's user avatar
  • 469
Best practices
0 votes
1 replies
27 views

How can I use C functions from the stats package in C++ code written with Rcpp? I'd like to use the logit link-function and link-inverse from the stats package. Since it's just two simple functions, I ...
snaut's user avatar
  • 2,682
2 votes
1 answer
139 views

How can I get a length one sub-vector of a NumericVector in Rcpp. Similar to the drop=FALSE argument in [ in R. The only solution I found so far is to use a length 1 NumericVector as an auxillary ...
snaut's user avatar
  • 2,682
4 votes
2 answers
214 views

Suppose I have the following list of vector List <- list(c(1:3), c(4:6), c(7:9)) To get the required result I have the following code in Rcpp totalCpp <- {"#include <Rcpp.h> using ...
Cantor_Set's user avatar
0 votes
1 answer
107 views

R package using RcppParallel builds but fails to install due to undefined TBB symbols Body: I'm developing an R package using RcppParallel to compute distance matrix. The package builds successfully, ...
marc's user avatar
  • 451
3 votes
1 answer
84 views

We are currently working on a package utilizing the constraint programming solver Gecode (6.2). For the sake of usability we would like to include the Gecode source files with the package, so users do ...
Nils Lüschow's user avatar
1 vote
1 answer
104 views

I'm developing an R package using Rcpp with OpenMP for parallelization. I'm facing an issue where threads are randomly spread across CPU cores, leading often to threads beeing scheduled primarily on ...
roh's user avatar
  • 11
0 votes
2 answers
74 views

I have a routine written in Rcpp that is supposed to generate random numbers. Strangely enough, if I also call a completely unrelated routine, it always returns the same number. Here is a toy example: ...
Wolfgang Rolke's user avatar
0 votes
0 answers
169 views

Using R 4.5.0 on a Windows 11 computer, loading the terra package with library(terra) in a clean R session makes R crash. The crash occurs half the time only; half the time it is successful. I noticed ...
Ivan's user avatar
  • 16
1 vote
1 answer
138 views

I was trying to brush up my RCpp skills and attempted to use sourceCpp() to use a simple hello_world.cpp program. However, I encounter ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-apple-...
FAM's user avatar
  • 113
0 votes
1 answer
112 views

Suppose I want to unit test a small Rcpp function I wrote by feeding it and the reference implementation of the function in R the same input and comparing the output. Below is a very simple example (...
titfortat's user avatar
2 votes
0 answers
126 views

I am working on a problem involving NIMBLE in R and I am getting the following error on compilation: > Cmodel <- compileNimble(Rmodel) Compiling [Note] This may take a minute. [Note] Use '...
Riley Mummah's user avatar
3 votes
0 answers
108 views

I want to add a Fortran routine (from a package that I found on the internet) to my own R package. My R package compiles just fine, and so does the package with the Fortran code, but when I add that ...
Wolfgang Rolke's user avatar
4 votes
1 answer
171 views

I'm having issues re-publishing an RShiny app I have published (and re-published) previously. The app runs fine locally (in the RStudio preview and if I run it in my browser), but when I try to re-...
Siobhan Schenk's user avatar
0 votes
1 answer
81 views

I'm building a R package from an existing C library using RStudio. I was testing the library in Windows using an Ubuntu terminal with WSL. It mainly uses these two commands: gcc -x c -o pvalues.so src/...
PabRvss's user avatar
1 vote
0 answers
80 views

I have an RcppArmadillo code that runs sequentially and I am trying to adapt it for parallel compilation with RcppParellel. The code is a copy paste of sequential code and actually runs faster. Yet ...
Juan Mucho's user avatar
0 votes
1 answer
68 views

I run R + Rcpp + RcppParallel from RStudio. I run a parallel loop that works if I do not use a Rcpp::List in the worker, but throws an abort if I use the Rcpp::List in the worker (even in a trivial ...
Andre Lucas's user avatar
0 votes
0 answers
109 views

I am developping a R function than used a function code in Rcpp (i am already new to this). I wanted to make simulations and run the same r functions in a cluster of x cores. Unfortunately when I do ...
Max13's user avatar
  • 37
0 votes
0 answers
131 views

this post is somewhat related to this post I did a couple of days ago: C++ AVX2 Function Pointers/std::function not working on Windows (but work on Linux) Now, since then, thanks to the useful ...
E_1996's user avatar
  • 89
1 vote
0 answers
136 views

I'm experiencing an issue where passing AVX2 functions through function pointers or std::function works fine on Linux, but crashes on Windows. Direct AVX2 operations work fine on both platforms. ...
E_1996's user avatar
  • 89
1 vote
1 answer
60 views

I have the following Rcpp code #include <RcppArmadillo.h> #define _USE_MATH_DEFINES #include<cmath> #include <boost/math/special_functions/bessel.hpp> #include <mlpack.h> #...
noirritchandra's user avatar
0 votes
0 answers
22 views

The code bellow executes in parallel the function "mhrcmx_dep_rep_int" (written in c++) of my R package "mhrcmxIntDepL": ### paths path = paste0(fs::path_home(),'/rcpedroso/CAI/'); ...
rcpedroso's user avatar
1 vote
1 answer
329 views

I am an R user but a novice in C++. I need a C++ workflow that returns the value of a GeoTiff at a specific (x, y) coordinate. The GeoTiff contains 1 layer. The layer is a 2-dimensional array. Each ...
Edward Lavender's user avatar
-1 votes
1 answer
92 views

I would like to store and operate an array of matrices (or pointers to them), which could be either arma::mat or arma::sp_mat of varying dimensions (passed from R via Rcpp). What would be the easiest ...
mskb's user avatar
  • 350
0 votes
0 answers
104 views

I'm doing matrix calculations, and in order to improve performance, I'm programming this process using Rcpp. However, I found that the results of the two calculations could not be consistent because ...
G WOLF's user avatar
  • 41
1 vote
1 answer
91 views

Following the tbb example for parallel_reduce here with a basic datatypes, I wanted to try and implement a tbb version of a row sum of an Armadillo matrix. (I realize the use of arma::sum for this ...
mskb's user avatar
  • 350
2 votes
1 answer
136 views

In order to speed up the calculation for very large matrices, I use Rcpp to perform the calculation, which involves regression analysis. I noticed in r's documentation that lm uses the qr ...
G WOLF's user avatar
  • 41
1 vote
1 answer
58 views

I'm getting a couple of error messages when I run the following code that I do not understand - expected initializer before 'add_f' no matching function for call to 'try_grid::try_grid(Rcpp::...
Barely_sufficient's user avatar
0 votes
0 answers
73 views

I was trying to download MetaboAnalystR in my Mac mini M4. It's required to install gfortran to compile the cpp. I went through the process in this page. However when I ran the test cpp file, it ...
Xiaomai Cao's user avatar
2 votes
1 answer
104 views

I get a subscript out of bounds warning, but the function seems to work fine and I don't see why the warning occurs. Here is a minimal example: NumericVector foo(double seed, int steps) { ...
Gerion's user avatar
  • 31
2 votes
1 answer
102 views

I'm very new to Rcpp and I would like to manipulate a matrix in Rcpp. I have a 3D matrix in R and I would like to transfer it to a function in Rcpp. I can't seem to do so! include <Rcpp.h> ...
Barely_sufficient's user avatar
2 votes
1 answer
69 views

I want to use a std::stack in a C++ function inside an R package. Consider the following example C++ file: // [[Rcpp::plugins(cpp20)]] #include <Rcpp.h> #include <stack> // [[Rcpp::export]...
user's user avatar
  • 1,150
1 vote
0 answers
84 views

I am trying to build an R library with an R function that call an Rcpp function. I used to call this Rcpp function through sourceCpp and it worked well. When trying to make the R library using roxygen ...
marc's user avatar
  • 451
0 votes
0 answers
217 views

When I try to install R Package Rcpp I got following ERROR Message. > install.packages("Rcpp") Installing package into ‘/<SOMEDIR>/r/lib_user’ (as ‘lib’ is unspecified) trying URL '...
Christopher Gies's user avatar
1 vote
1 answer
59 views

Consider the following reprex: //test.cpp #include <Rcpp.h> // [[Rcpp::plugins(openmp)]] using namespace Rcpp; #ifdef _OPENMP #include <omp.h> #endif //[[Rcpp::export]] void ...
BerriJ's user avatar
  • 1,029
2 votes
1 answer
85 views

Reprex: // [[Rcpp::export]] int dbl2int(double x) { return x; } /*** R dbl2int(NA_real_) */ Rcpp::sourceCpp("test-dbl2int.cpp") On Mac, it outputs 0, while it outputs NA_INTEGER on Windows ...
F. Privé's user avatar
  • 11.8k
1 vote
1 answer
84 views

I am running the latest R and Rcpp under MacOS Sonoma. I am attempting to add a new function call C++ code to a very old package (Hmisc), setting things up using Rcpp::compileAttributes(). The new R ...
Frank Harrell's user avatar
0 votes
0 answers
62 views

Is there an elementary function in Rcpp to transform a Rcpp::list object within Rcpp to a Rcpp::NumericVector? One way would be to import the unlist function of R, but thats not very elegant.
anjo1659's user avatar
0 votes
0 answers
93 views

I am trying to reproduce the example here to debug RCPP code with VS Code on Windows. Here is my launch.json config: { "version": "0.2.0", "configurations": [ { ...
LaTate's user avatar
  • 1
2 votes
1 answer
69 views

I have an R program, that calls two R functions, f1 and f2. f1 calls stats::dnorm (which is an R wrapper for some C code, called C_dnorm). f2 calls extraDistr::dgev (which is an R wrapper for some CPP ...
Stephen Jewson's user avatar
2 votes
1 answer
161 views

I'm building a small R package using CUDA and Rcpp as a learning exercise (using Building a tiny R package with CUDA and Rcpp as inspiration). It includes a single function that takes a device ID and ...
KMlsn's user avatar
  • 51
0 votes
1 answer
2k views

I have recently moved to Mac OS Sonoma 14.5 and I am now trying to use my previous R script based on Rcpp (sourcing C++ in R). I have been having serious difficulties understanding how to link the ...
CafféSospeso's user avatar
1 vote
1 answer
189 views

I'm trying to install a package in R, and I get the following error: clang: error: unsupported option '-fopenmp' This, is after I got an error: ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-...
Kozolovska's user avatar
  • 1,119
0 votes
1 answer
100 views

I have installed Rcpp, RcppParallel and I was testing simple function, written in .cpp file. #include <RcppParallel.h> #include <Rcpp.h> #include <vector> using namespace ...
Kamat's user avatar
  • 123
0 votes
0 answers
79 views

I switched from R-3.6.3 to R-4.3.1 and R-4.4.1. I tried to sourceCpp() some *.cpp which worked fine for R-3.6.3, but not for R-4.3.1 and R-4.4.1. The error is copied below. Rcpp::evalCpp("2 + 2&...
sebastiann's user avatar
1 vote
0 answers
39 views

I am trying to write a system of differential equations that can account for fecundity and maturation occurring at specific time steps throughout the years. Currently, this is the code that I have set ...
coltonp2018's user avatar
1 vote
1 answer
105 views

I am creating a Dockerfile to run R workloads in Lambda based on a template from the lambdr package, which relies on an Amazon Linux base image and yum package manager. I need glmnet for one of the ...
Alberto Agudo Dominguez's user avatar
1 vote
1 answer
208 views

In brief: I never faced the problem that I can install a package, but I am not able to re-install the unchanged package. How can I solve that problem? It only affects a package which uses Rcpp - all ...
Christoph's user avatar
  • 7,277
2 votes
0 answers
81 views

In short: I tried with SO and chatGPT, at some point I thought the NAMESPACE file was the error and deleted it. However, I still get an error when I run Rcpp::compileAttributes(pkgdir = "...
Christoph's user avatar
  • 7,277
0 votes
1 answer
81 views

I'm unsure how to only put RcppEigen under the LinkingTo and not the Imports headers. I've gotten conflicting instructions and am very confused what to do. I've been learning how to use Eigen myself, ...
user25262461's user avatar

1
2 3 4 5
63