Functions for low-level operations on C pointers as well as
helper functions and objects to handle C
float arrays and strings.
1 2 3 4 5 6 7 8 9 10
an R object.
number of elements to allocate.
a offset given in bytes.
is.nullptr tests if the external pointer given by
x represents a C
as.extptr returns an external pointer to the data area of atomic
vector given by
x. The external pointer holds an additional reference
x R object to prevent it from garbage collection.
is.externalptr tests if the object given by
x is an external pointer.
floatraw creates an array with a capacity to store
n single-precision C
The array is implemented via a
as.floatraw coerces a numeric vector into a single-precision C
Values given by
x are converted to C
float values and stored in the R raw vector via
This function is useful when calling foreign functions that expeect a C
float pointer via
floatraw2numeric coerces a C
float (raw) vector to a numeric vector.
strptr are currently experimental.
offsetPtr creates a new external pointer pointing to
x plus the byte
x is given as an external pointer, the address is increased by the
x is given as a atomic vector, the address of the data (pointing to offset zero) is taken as basis
and increased by the
The returned external pointer is protected (as offered by the C function
R_MakeExternalPtr) by the external pointer
A logical value is returned by
as.extptr returns an external pointer value.
as.floatraw return an atomic vector of type
tagged with class
floatraw2numeric returns a
numeric atomic vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.