search for: printlst

Displaying 2 results from an estimated 2 matches for "printlst".

Did you mean: printlist
2005 Jan 31
2
type of list elements in .Call
...Here is something I do not understand. Consider ************************************************* foo.cc ************************************************* #include <iostream> #include <R.h> #include <Rinternals.h> using std::cout; using std::endl; extern "C" { SEXP printlst(SEXP lst); } SEXP printlst(SEXP lst) { for(int i=0; i<length(lst); i++) for(int j=0; j<length(VECTOR_ELT(lst, i)); j++) cout << INTEGER(VECTOR_ELT(lst, i))[j] << endl; return lst; } ************************************************* > dyn.load("foo.so&qu...
2005 Jan 31
3
type of list elements in .Call
...Here is something I do not understand. Consider ************************************************* foo.cc ************************************************* #include <iostream> #include <R.h> #include <Rinternals.h> using std::cout; using std::endl; extern "C" { SEXP printlst(SEXP lst); } SEXP printlst(SEXP lst) { for(int i=0; i<length(lst); i++) for(int j=0; j<length(VECTOR_ELT(lst, i)); j++) cout << INTEGER(VECTOR_ELT(lst, i))[j] << endl; return lst; } ************************************************* > dyn.load("foo.so&qu...