The code that you write within parallel workers should not call the R or Rcpp API in any fashion. This is because R is single-threaded and concurrent interaction with it’s data structures can cause crashes and other undefined behavior.
The next section then describes the straightforward solution of wrapping them all as RVector or RMatrix. There are currently exceptions to this which must be fixed.
From the Rcpp site:
The next section then describes the straightforward solution of wrapping them all as
RVector
orRMatrix
. There are currently exceptions to this which must be fixed.