[R] Linking to C type short?

Spencer Graves spencer.graves at structuremonitoring.com
Thu Jul 26 22:22:22 CEST 2012

Hello, All:

       What references exist on how to link to C?

       I'm familiar with sections 5.2 and 5.6 of the "Writing R 
Extension" manual plus chapter 6 of Venables and Ripley (2000) S 
Programming (Springer).  From these, I get the following:

R storage mode   C type
logical          int *
integer          int *
double           double *
complex          Rcomplex *
character        char **
raw              unsigned char *
list             SEXP *
R object         SEXP

       "integer" and "int" are 32 bits.  If I understand correctly, 
"short" has only 16 bits = 2 bytes.

       Should I define any "short" vector in C as a matrix with 2 rows 
of type either "raw" or "char"?


p.s.  I need this to link to lossless JPEG code obtained from 

Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com

More information about the R-help mailing list