Rf_ScalarRaw.Rd
x | an Rbyte value. |
---|
A SEXP object, namely a length one (one byte) raw
vector.
SEXP Rf_ScalarRaw(Rbyte x);
In Rinternals.h.
INLINE_FUN SEXP ScalarRaw(Rbyte x) { SEXP ans = allocVector(RAWSXP, 1); SET_SCALAR_BVAL(ans, x); return ans; }
In Rinlinedfuns.h.
# Convert a C unsigned char to an R length one raw vector asterisk_byte <- inline::cfunction(NULL, " Rbyte x = '*'; // '*' is 42 in decimal, 2a in hexadecimal. SEXP y; y = PROTECT(Rf_ScalarRaw(x)); UNPROTECT(1); return y; " Rbyte x = '*'; // '*' is 42 in decimal, 2a in hexadecimal. SEXP y; y = PROTECT(Rf_ScalarRaw(x)); UNPROTECT(1); return y; ") asterisk_byte()#> [1] 2a