Hi rcpp-devel,

How can I test if a member of a list is a NULL value ?

I have this kind of R code

# create a list with all the parameters for initializing the algorithms
`initAlgo`<-function( algo="EM"
                              , init= NULL
                              , nbTry= NULL
                          )
{
     listOptions <- list( algo= algo, init= init, nbTry= nbTry )
     listOptions
}

# call c/C++
 res_cluster <- .Call("MyFunction", data, options = initAlgo())


and this kind of C/C++ code

cppExport SEXP MyFunction( SEXP data, SEXP algoOptions)
{
BEGIN_RCPP

   // wrap data in Rcpp matrix
   Rcpp::NumericMatrix RData(data); // creates Rcpp matrix from SEXP
   // wrap list algoOptions
   Rcpp::List RalgoOptions(algoOptions);

..........
}


I would like to test if the init and nbTry parameter in the RalgoOptions are NULL and I don't find
any documentation about the way to do it.

Thanks
Serge Iovleff

-- 
USTL - IUT "A" - 3A56    | Tel: (33) 3 59 63 22 20
Département Informatique | Fax: (33) 3 59 63 22 22
BP 90179                 | www.iut-info.univ-lille1.fr/~iovleff
59653 Villeneuve d'Ascq  | [email protected]


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to