Difference between RInside and Rcpp

懵懂的女人 提交于 2019-12-02 16:38:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!