방금 Rcpp로 시작했습니다. 나는 두개의 수치 벡터를 취하여 그들의 합집합을 계산하고 수치 벡터를 반환하는 간단한 프로그램을 가지고있다. 목록은 아래에 붙여 넣어집니다 (test.cpp
). 'coerceToReal'에 'builtin'이 구현되지 않았습니다. [Rcpp]
#include <Rcpp.h>
#include <algorithm>
using namespace Rcpp;
// [[Rcpp::export]]
NumericVector test(NumericVector x, NumericVector y) {
int n = x.size() + y.size();
std::vector<int> v(n);
std::vector<int>::iterator it;
std::sort(x.begin(), x.end());
std::sort(y.begin(), y.end());
it=std::set_union(x.begin(), x.end(), y.begin(), y.end(), v.begin());
v.resize(it-v.begin());
return wrap(v);
}
/*** R
x <- c(5,10,15,20,25)
y <- c(50,40,30,20,10)
test(x, y)
*/
내가 값
기능이 작동x <- sample(20000)
y <- sample(20000)
test(x, y)
으로 프로그램을 실행하려고
. 하지만 출력Error in .Primitive(".Call")(<pointer: 0x7f1819d8af20>, x, y) :
unimplemented type 'builtin' in 'coerceToReal'
무슨 일이 일어나고있는 어떤 아이디어와 가치
x <- sample(1000000)
y <- sample(1000000)
test(x, y)
프로그램 충돌의 수를 증가 할 때? 모든 포인터 또는 참조 주셔서 감사합니다.
잘 작동합니다 ... 시스템 사양은 무엇입니까? –
@JosephWood Linuc 우분투 상자, 16GB RAM. – Andrej