Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. int find_sexp_type (const Rcpp::RObject& incoming) {
  2. if (incoming.isObject()) {
  3. const std::string classname=get_class(incoming);
  4. if (classname=="HDF5Matrix") {
  5. Rcpp::RObject h5seed=get_safe_slot(incoming, "seed");
  6. Rcpp::RObject first_val=get_safe_slot(h5seed, "first_val");
  7. return first_val.sexp_type();
  8. } else if (classname.length()==9 && classname.substr(3)=="Matrix") {
  9. if (classname[0]=="d") {
  10. return REALSXP;
  11. } else (classname[0]=="l") {
  12. return LGLSXP;
  13. }
  14. }
  15. throw_custom_error("unknown SEXP type for ", classname, " object");
  16. }
  17. return incoming.sexp_type();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement