Description Arguments Value Declaration Examples
Converts a double x
to a SEXP object that represents an R length one
numeric
vector.
x |
a double |
A SEXP object, namely a length one numeric
vector.
1 | SEXP Rf_ScalarReal(double x);
|
In Rinternals.h.
1 2 3 4 5 6 7 8 9 | # Convert a C double number as an R length one numeric vector
forty_two <- inline::cfunction(NULL,
' double x = 42.;
SEXP y;
y = PROTECT(Rf_ScalarReal(x));
UNPROTECT(1);
return y;
')
forty_two()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.