请问如何在Rcpp中使用三维数据,代码如下,不能编译通过。 非常感谢高人相助!
cppFunction('
List SimpleLoop(IntegerVector TR,IntegerVector nR,IntegerVector mR){
int T=TR(0);
int n=nR(0);
int m=mR(0);
NumericVector rArray(Dimension(T,n,m));
rArray(0)(0)(1)=1.1;
//rArray(1,1,1)=1.1;
return List::create(Named("rArray")=rArray);
}
')
T=5;
n=5;
m=5;
OP<-SimpleLoop(as.integer(T),as.integer(n),as.integer(m));
OP$rArray