Displaying 2 results from an estimated 2 matches for "user_object_".
Did you mean:
user_object
2005 Jul 15
3
Passing character strings from C code to R
Hi,
I have a C code which produces array of integers and potentially a string,
and I have problems passing the string out. Here is the relevant part of the
code:
1 PROTECT(Ret = allocVector(INTSXP, n));
2 ret = (int*) INTEGER(Ret); /* get pointer to R's Ret */
3 for(i=0; i<n; i++) ret[i] = data[i];
4 Free(data);
5 i=1;
6 if (comment) { // comment was found
7 n
2005 Jul 15
3
Passing character strings from C code to R
Hi,
I have a C code which produces array of integers and potentially a string,
and I have problems passing the string out. Here is the relevant part of the
code:
1 PROTECT(Ret = allocVector(INTSXP, n));
2 ret = (int*) INTEGER(Ret); /* get pointer to R's Ret */
3 for(i=0; i<n; i++) ret[i] = data[i];
4 Free(data);
5 i=1;
6 if (comment) { // comment was found
7 n