Rf_ScalarReal: Rf_ScalarReal

Description Arguments Value Declaration Examples

Description

\Sexpr[results=rd, stage=render]{c3po:::badge('fnp')} \Sexpr[results=rd, stage=render]{c3po:::badge('c2r')} \Sexpr[results=rd, stage=render]{c3po:::badge('prot')}

Converts a double x to a SEXP object that represents an R length one numeric vector.

Arguments

x

a double

Value

A SEXP object, namely a length one numeric vector.

Declaration

1

In Rinternals.h.

Examples

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()

ramiromagno/c3po documentation built on Jan. 5, 2021, 8:01 p.m.