Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int find_sexp_type (const Rcpp::RObject& incoming) {
- if (incoming.isObject()) {
- const std::string classname=get_class(incoming);
- if (classname=="HDF5Matrix") {
- Rcpp::RObject h5seed=get_safe_slot(incoming, "seed");
- Rcpp::RObject first_val=get_safe_slot(h5seed, "first_val");
- return first_val.sexp_type();
- } else if (classname.length()==9 && classname.substr(3)=="Matrix") {
- if (classname[0]=="d") {
- return REALSXP;
- } else (classname[0]=="l") {
- return LGLSXP;
- }
- }
- throw_custom_error("unknown SEXP type for ", classname, " object");
- }
- return incoming.sexp_type();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement