I create my own function in the .clanguage. Then I create a function R to call the function .cusing .cfor example
tmp <- .C("myfunction",
as.integer(N),
as.integer(n),
as.integer(w1),
as.integer(w2),
as.integer(w3),
PACKAGE = "mypackage")[[3]]
which is called the wreper R-function. In addition, my function is based on other functions .c. As I know, use Rcppmakes it more flexible and easy, so:
cppFunction('int add(int x, int y, int z) {
int sum = x + y + z;
return sum;
}')
I also know what cppFunctionworks with the language C++. However, I see that between the .cfunction and .c++there is nothing else.
: cppFunction .c, requrie wraper R? .c .c++? , ? R?
: , cppFunction myfunc1 myfunc2, myfunc2 myfunc1. , cppFunction :
cppFunction('int myfunc2(int x, int y, int z) {
int sum = x + y + z;
myfunc1 ## do some works here
return something;
}')
? :
cppFunction('int myfunc2(int x, int y, int z) {
int sum = x + y + z;
cppFunction('int myfunc2(int some arguments) {
return something;
}')
, build cppFunction, ?
?
user7905871