Rcpp side effects due to call-by-address
Summary Rcpp functions can modify input variables in the calling environment due to call-by-address semantics, leading to unintended side effects. This occurs when the input variable is passed as a reference, allowing modifications in the C++ function to persist in the R environment. Root Cause Call-by-address: Rcpp passes variables by reference, not by value, unlike … Read more