It works, thanks a lot!
Qiang Kou 于2016年11月11日 周五09:07写道:
> Hi, Jingyu,
>
> I post a small example below. I think this is what you want.
>
> Best,
>
> KK
>
> #include
>
> using namespace Rcpp;
>
> //[[Rcpp::export]]
> void test(Nullable f = R_NilValue) {
> if (f.isNotNull()) {
> Rcpp::Rcout
Hi, Jingyu,
I post a small example below. I think this is what you want.
Best,
KK
#include
using namespace Rcpp;
//[[Rcpp::export]]
void test(Nullable f = R_NilValue) {
if (f.isNotNull()) {
Rcpp::Rcout << "Not NULL fun" << std::endl;
Function f2(f);
f2();
} else {
Rcout <
On 11 November 2016 at 05:53, Jingyu He wrote:
| I've deleted the post on StackOverflow. Sorry for the ambiguity, the problem
is
| not arg, but the Function f.
|
|
| #include
| using namespace Rcpp;
| // [[Rcpp::export]]
| RObject cppfunction(Function rfunction = NULL) {
| if( rfunction