C++ 怀疑运行c++;使用R的代码
我试图使用R处理c++代码,但我不能使用其他库中的对象C++ 怀疑运行c++;使用R的代码,c++,r,vector,C++,R,Vector,我试图使用R处理c++代码,但我不能使用其他库中的对象 #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int fun(int x, int n) { for(int i=0;i<=n;i++){ x=x+n; } return x; } #包括 使用名称空间Rcpp; //[[Rcpp::导出]] int fun(int x,int n){ 对于(int i=0;请参阅本页向
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
int fun(int x, int n) {
for(int i=0;i<=n;i++){
x=x+n;
}
return x;
}
#包括
使用名称空间Rcpp;
//[[Rcpp::导出]]
int fun(int x,int n){
对于(int i=0;请参阅本页向量输入标量输出部分的代码:@G.Grothendieck非常感谢!!