Description Arguments Value Declaration Definition Examples
Converts an Rcomplex x
to a SEXP
object that
represents an R length one complex
vector.
x |
an |
A SEXP
object, namely a length one complex
vector.
1 |
In Rinternals.h.
1 2 3 4 5 6 |
In Rinlinedfuns.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Convert a C complex number to an R length one complex vector
scalar_complex <- inline::cfunction(NULL,
'double real = 1.;
double imaginary = 2.;
Rcomplex x;
x.r = real;
x.i = imaginary;
SEXP y;
y = PROTECT(Rf_ScalarComplex(x));
UNPROTECT(1);
return y;
')
scalar_complex()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.