Displaying 1 result from an estimated 1 matches for "read_my_data".
2013 Dec 16
1
External pointers and changing SEXPTYPE
...al pointer to a structure holding several types of data,
including SEXPs, I discovered that SEXPs change their types between
returning from initialization function and another one that uses the
pointer.
sample R code:
# initializing
a <- init_my_ptr(fname)
# reading more data: error!
df <- read_my_data(a)
data structure in C:
typedef struct {
SEXP ans, ans_nms, R_z, R_a, R_b, R_c;
FTYPE *datafile;
char *fname;
float *a, *b, *c;
int f_type;
float t, p, l;
int st, na, result, bFlags;
XXX z;
} my_data_ptr;
// In a C function initializing the external pointer:
my_data_ptr *mydata =...