On 2/3/2004 at 5:02 PM Roger Bivand wrote:
Yes. First make sure you have your "Writing R Extensions" handy. Next
decide whether you are going to use Rdefines.h or Rinternals.h. Then read
the chosen header file (in R/includes/). (Rdefines.h includes
Rinternals.h). For example line 255 in Rinternals.h gives
#define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
I have used incantations like
CHAR(STRING_ELT(x, 0))
where x is a character vector - be prepared to use Rprintf() to check that
your assignment works out.