c++ - RInside 和 Rcpp 的区别

标签 c++ r rcpp rinside

我理解 RInside 允许 C++ 程序嵌入 R 代码,而 Rcpp 允许 R 代码调用 C++ 函数或库。

RInside 和 Rcpp 之间还有其他区别和共同点吗?为什么 RInside 有一个名为 Rcpp 的命名空间?开发人员是否总是需要同时使用 RInside 和 Rcpp 才能在 Cpp 中将 R 代码作为一个类来调用?

最佳答案

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.

所以看起来 Rcpp 是较低级别的,并且促进了两种语言之间的通信,不仅仅是像你所说的从 R 到 C++,而是双向通信。另一方面,RInside 是构建在 Rcpp 之上的更高级别的库,专注于将 R 轻松嵌入到 C++ 中。

关于c++ - RInside 和 Rcpp 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47098916/

相关文章:

C++ 跳出 vector 循环

c# - C++ 和 C# 之间的 token 登录?

r - R 中应用/反转函数的奇怪行为

c++ - 分配大 vector 的问题

c - 如何使用 Rcpp 创建依赖于共享库的 R 包?

c++ - `operator>>' 不是 `Instance' 的成员

c++ - 需要改进我的代码的建议 : Search Algorithm

python - 从 rpy2 导入 robjects 时出现 Segmentation fault Core dumped 错误

r - Julia 中 R 的模拟函数的模拟?

c++ - 在 rcpp 中将列表转换为矩阵