-
-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
It seems that piping text containing a C++ function into cppFunction() doesn't lead to the function becoming part of the environment. (code
is the first argument fo cppFunction() so I thought that it should work.)
Here's an example that didn't work for me:
'int fibonacci(const int x) {
if (x == 0) return(0);
if (x == 1) return(1);
return (fibonacci(x - 1)) + fibonacci(x - 2);
}' %>% cppFunction()
In contrast, this worked perfectly for me:
cppFunction(
'int fibonacci(const int x) {
if (x == 0) return(0);
if (x == 1) return(1);
return (fibonacci(x - 1)) + fibonacci(x - 2);
}')
(I am using R version 3.4.0 on 64 bit Windows 7 with version 0.12.10 of Rcpp.)
Metadata
Metadata
Assignees
Labels
No labels