RAPI
Defines
Rdefines.h File Reference
#include <R_ext/Memory.h>
#include <R_ext/RS.h>
#include <Rinternals.h>
Include dependency graph for Rdefines.h:

Go to the source code of this file.

Defines

#define NULL_USER_OBJECT   R_NilValue
#define AS_LOGICAL(x)   Rf_coerceVector(x,LGLSXP)
#define AS_INTEGER(x)   Rf_coerceVector(x,INTSXP)
#define AS_NUMERIC(x)   Rf_coerceVector(x,REALSXP)
#define AS_CHARACTER(x)   Rf_coerceVector(x,STRSXP)
#define AS_COMPLEX(x)   Rf_coerceVector(x,CPLXSXP)
#define AS_VECTOR(x)   Rf_coerceVector(x,VECSXP)
#define AS_LIST(x)   Rf_coerceVector(x,VECSXP)
#define AS_RAW(x)   Rf_coerceVector(x,RAWSXP)
#define IS_LOGICAL(x)   Rf_isLogical(x)
#define IS_INTEGER(x)   Rf_isInteger(x)
#define IS_NUMERIC(x)   Rf_isReal(x)
#define IS_CHARACTER(x)   Rf_isString(x)
#define IS_COMPLEX(x)   Rf_isComplex(x)
#define IS_VECTOR(x)   Rf_isVector(x)
#define IS_LIST(x)   IS_VECTOR(x)
#define IS_RAW(x)   (TYPEOF(x) == RAWSXP)
#define NEW_LOGICAL(n)   Rf_allocVector(LGLSXP,n)
#define NEW_INTEGER(n)   Rf_allocVector(INTSXP,n)
#define NEW_NUMERIC(n)   Rf_allocVector(REALSXP,n)
#define NEW_CHARACTER(n)   Rf_allocVector(STRSXP,n)
#define NEW_COMPLEX(n)   Rf_allocVector(CPLXSXP,n)
#define NEW_LIST(n)   Rf_allocVector(VECSXP,n)
#define NEW_STRING(n)   NEW_CHARACTER(n)
#define NEW_RAW(n)   Rf_allocVector(RAWSXP,n)
#define LOGICAL_POINTER(x)   LOGICAL(x)
#define INTEGER_POINTER(x)   INTEGER(x)
#define NUMERIC_POINTER(x)   REAL(x)
#define CHARACTER_POINTER(x)   STRING_PTR(x)
#define COMPLEX_POINTER(x)   COMPLEX(x)
#define LIST_POINTER(x)   VECTOR_PTR(x)
#define RAW_POINTER(x)   RAW(x)
#define LOGICAL_DATA(x)   (LOGICAL(x))
#define INTEGER_DATA(x)   (INTEGER(x))
#define DOUBLE_DATA(x)   (REAL(x))
#define NUMERIC_DATA(x)   (REAL(x))
#define CHARACTER_DATA(x)   (STRING_PTR(x))
#define COMPLEX_DATA(x)   (COMPLEX(x))
#define RECURSIVE_DATA(x)   (VECTOR_PTR(x))
#define VECTOR_DATA(x)   (VECTOR_PTR(x))
#define LOGICAL_VALUE(x)   Rf_asLogical(x)
#define INTEGER_VALUE(x)   Rf_asInteger(x)
#define NUMERIC_VALUE(x)   Rf_asReal(x)
#define CHARACTER_VALUE(x)   CHAR(Rf_asChar(x))
#define STRING_VALUE(x)   CHAR(Rf_asChar(x))
#define LIST_VALUE(x)   Rf_error("the 'value' of a list object is not defined")
#define RAW_VALUE(x)   Rf_error("the 'value' of a raw object is not defined")
#define SET_ELEMENT(x, i, val)   SET_VECTOR_ELT(x, i, val)
#define GET_ATTR(x, what)   Rf_getAttrib(x, what)
#define GET_CLASS(x)   Rf_getAttrib(x, R_ClassSymbol)
#define GET_DIM(x)   Rf_getAttrib(x, R_DimSymbol)
#define GET_DIMNAMES(x)   Rf_getAttrib(x, R_DimNamesSymbol)
#define GET_COLNAMES(x)   Rf_GetColNames(x)
#define GET_ROWNAMES(x)   Rf_GetRowNames(x)
#define GET_LEVELS(x)   Rf_getAttrib(x, R_LevelsSymbol)
#define GET_TSP(x)   Rf_getAttrib(x, R_TspSymbol)
#define GET_NAMES(x)   Rf_getAttrib(x, R_NamesSymbol)
#define SET_ATTR(x, what, n)   Rf_setAttrib(x, what, n)
#define SET_CLASS(x, n)   Rf_setAttrib(x, R_ClassSymbol, n)
#define SET_DIM(x, n)   Rf_setAttrib(x, R_DimSymbol, n)
#define SET_DIMNAMES(x, n)   Rf_setAttrib(x, R_DimNamesSymbol, n)
#define SET_LEVELS(x, l)   Rf_setAttrib(x, R_LevelsSymbol, l)
#define SET_NAMES(x, n)   Rf_setAttrib(x, R_NamesSymbol, n)
#define GET_LENGTH(x)   Rf_length(x)
#define SET_LENGTH(x, n)   (x = Rf_lengthgets(x, n))
#define GET_SLOT(x, what)   R_do_slot(x, what)
#define SET_SLOT(x, what, value)   R_do_slot_assign(x, what, value)
#define MAKE_CLASS(what)   R_do_MAKE_CLASS(what)
#define NEW_OBJECT(class_def)   R_do_new_object(class_def)
#define NEW(class_def)   R_do_new_object(class_def)
#define s_object   SEXPREC
#define S_EVALUATOR
#define TRUE   1
#define FALSE   0
#define COPY_TO_USER_STRING(x)   mkChar(x)
#define CREATE_STRING_VECTOR(x)   mkChar(x)
#define CREATE_FUNCTION_CALL(name, argList)   createFunctionCall(name, argList)
#define EVAL(x)   eval(x,R_GlobalEnv)

Define Documentation

#define AS_CHARACTER (   x)    Rf_coerceVector(x,STRSXP)
#define AS_COMPLEX (   x)    Rf_coerceVector(x,CPLXSXP)
#define AS_INTEGER (   x)    Rf_coerceVector(x,INTSXP)
#define AS_LIST (   x)    Rf_coerceVector(x,VECSXP)
#define AS_LOGICAL (   x)    Rf_coerceVector(x,LGLSXP)
#define AS_NUMERIC (   x)    Rf_coerceVector(x,REALSXP)
#define AS_RAW (   x)    Rf_coerceVector(x,RAWSXP)
#define AS_VECTOR (   x)    Rf_coerceVector(x,VECSXP)
#define CHARACTER_DATA (   x)    (STRING_PTR(x))
#define CHARACTER_POINTER (   x)    STRING_PTR(x)
#define CHARACTER_VALUE (   x)    CHAR(Rf_asChar(x))
#define COMPLEX_DATA (   x)    (COMPLEX(x))
#define COMPLEX_POINTER (   x)    COMPLEX(x)
#define COPY_TO_USER_STRING (   x)    mkChar(x)
#define CREATE_FUNCTION_CALL (   name,
  argList 
)    createFunctionCall(name, argList)
#define CREATE_STRING_VECTOR (   x)    mkChar(x)
#define DOUBLE_DATA (   x)    (REAL(x))
#define EVAL (   x)    eval(x,R_GlobalEnv)
#define FALSE   0
#define GET_ATTR (   x,
  what 
)    Rf_getAttrib(x, what)
#define GET_CLASS (   x)    Rf_getAttrib(x, R_ClassSymbol)
#define GET_COLNAMES (   x)    Rf_GetColNames(x)
#define GET_DIM (   x)    Rf_getAttrib(x, R_DimSymbol)
#define GET_DIMNAMES (   x)    Rf_getAttrib(x, R_DimNamesSymbol)
#define GET_LENGTH (   x)    Rf_length(x)
#define GET_LEVELS (   x)    Rf_getAttrib(x, R_LevelsSymbol)
#define GET_NAMES (   x)    Rf_getAttrib(x, R_NamesSymbol)
#define GET_ROWNAMES (   x)    Rf_GetRowNames(x)
#define GET_SLOT (   x,
  what 
)    R_do_slot(x, what)
#define GET_TSP (   x)    Rf_getAttrib(x, R_TspSymbol)
#define INTEGER_DATA (   x)    (INTEGER(x))
#define INTEGER_POINTER (   x)    INTEGER(x)
#define INTEGER_VALUE (   x)    Rf_asInteger(x)
#define IS_CHARACTER (   x)    Rf_isString(x)
#define IS_COMPLEX (   x)    Rf_isComplex(x)
#define IS_INTEGER (   x)    Rf_isInteger(x)
#define IS_LIST (   x)    IS_VECTOR(x)
#define IS_LOGICAL (   x)    Rf_isLogical(x)
#define IS_NUMERIC (   x)    Rf_isReal(x)
#define IS_RAW (   x)    (TYPEOF(x) == RAWSXP)
#define IS_VECTOR (   x)    Rf_isVector(x)
#define LIST_POINTER (   x)    VECTOR_PTR(x)
#define LIST_VALUE (   x)    Rf_error("the 'value' of a list object is not defined")
#define LOGICAL_DATA (   x)    (LOGICAL(x))
#define LOGICAL_POINTER (   x)    LOGICAL(x)
#define LOGICAL_VALUE (   x)    Rf_asLogical(x)
#define MAKE_CLASS (   what)    R_do_MAKE_CLASS(what)
#define NEW (   class_def)    R_do_new_object(class_def)
#define NEW_CHARACTER (   n)    Rf_allocVector(STRSXP,n)
#define NEW_COMPLEX (   n)    Rf_allocVector(CPLXSXP,n)
#define NEW_INTEGER (   n)    Rf_allocVector(INTSXP,n)
#define NEW_LIST (   n)    Rf_allocVector(VECSXP,n)
#define NEW_LOGICAL (   n)    Rf_allocVector(LGLSXP,n)
#define NEW_NUMERIC (   n)    Rf_allocVector(REALSXP,n)
#define NEW_OBJECT (   class_def)    R_do_new_object(class_def)
#define NEW_RAW (   n)    Rf_allocVector(RAWSXP,n)
#define NEW_STRING (   n)    NEW_CHARACTER(n)
#define NUMERIC_DATA (   x)    (REAL(x))
#define NUMERIC_POINTER (   x)    REAL(x)
#define NUMERIC_VALUE (   x)    Rf_asReal(x)
#define RAW_POINTER (   x)    RAW(x)
#define RAW_VALUE (   x)    Rf_error("the 'value' of a raw object is not defined")
#define RECURSIVE_DATA (   x)    (VECTOR_PTR(x))
#define S_EVALUATOR
#define s_object   SEXPREC
#define SET_ATTR (   x,
  what,
 
)    Rf_setAttrib(x, what, n)
#define SET_CLASS (   x,
 
)    Rf_setAttrib(x, R_ClassSymbol, n)
#define SET_DIM (   x,
 
)    Rf_setAttrib(x, R_DimSymbol, n)
#define SET_DIMNAMES (   x,
 
)    Rf_setAttrib(x, R_DimNamesSymbol, n)
#define SET_ELEMENT (   x,
  i,
  val 
)    SET_VECTOR_ELT(x, i, val)
#define SET_LENGTH (   x,
 
)    (x = Rf_lengthgets(x, n))
#define SET_LEVELS (   x,
 
)    Rf_setAttrib(x, R_LevelsSymbol, l)
#define SET_NAMES (   x,
 
)    Rf_setAttrib(x, R_NamesSymbol, n)
#define SET_SLOT (   x,
  what,
  value 
)    R_do_slot_assign(x, what, value)
#define STRING_VALUE (   x)    CHAR(Rf_asChar(x))
#define TRUE   1
#define VECTOR_DATA (   x)    (VECTOR_PTR(x))
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines