search for: p_myint

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

Did you mean: myint
2005 Apr 14
1
question about "R get vector from C"
...rs, I want to let R get vector from c ,for example :numeric array ,vector .I saw some exmple like this : /* useCall3.c */ /* Getting an integer vector from C using .Call */ #include <R.h> #include <Rdefines.h> SEXP setInt() { SEXP myint; int *p_myint; int len = 5; PROTECT(myint = NEW_INTEGER(len)); // Allocating storage space p_myint = INTEGER_POINTER(myint); p_myint[0] = 7; UNPROTECT(1); return myint; } then type at the command prompt: R CMD SHLIB useCall3.c to get useCall3.so In windows platform ,how can I create right dll...
2006 May 08
1
Calling C++ code fom R --How to export C++ "unsigned" integer to R?
...Is there a way to export C++ "unsigned" integer to R? (I am trying to parse files in "BPMAP" format, and some variables are of type unsigned int (first declared in C++) ). I know that to export signed integer to R, I can do the following in C++: int Some_INTEGER = 5; int *p_myInt; SEXP myInt; PROTECT(myInt=NEW_INTEGER(1)); myInt[0] = Some_INTEGER; UNPROTECT(1); return myInt; However, it appears that myInt is a signed integer. I have looked over Rdefines.h and it does not look like there is a definition for NEW_UNSIGNED_INTEGER ! How would I export an unsigned inte...