问题
I understand RInside allows C++ program to embed R code, while Rcpp enables R code to call C++ functions or library.
Are there other differences and commonalities between RInside and Rcpp? Why RInside has a namespace called Rcpp? Do developers always need both RInside and Rcpp to call R code as a class in Cpp?
回答1:
Rcpp:
The Rcpp package provides R functions and a C++ library facilitating the integration of R and C++.
RInside:
The RInside package provides a few classes for seamless embedding of R inside of C++ applications by relying on Rcpp.
So it appears the Rcpp is lower level and facilities the communication between the two languages, not just from R to C++ as you state but communication in both directions. RInside, on the other hand, is higher level library built on top of Rcpp focused on easy embedding of R into C++.
来源:https://stackoverflow.com/questions/47098916/difference-between-rinside-and-rcpp