Skip to contents

get_data_ptr() returns a character string representation of the address of the first value in the C array underlying a given R vector of raw, integer, double or complex. The returned string is suitable for use as a DATAPOINTER for a GDAL MEM dataset (https://gdal.org/en/stable/drivers/raster/mem.html).

Usage

get_data_ptr(x)

Arguments

x

Vector of type double, integer, raw or complex.

Value

Character string pointer address with format suitable as DATAPOINTER for a GDAL MEM dataset.

See also

Examples

v <- sample(0:255, 20, replace = TRUE)
get_data_ptr(v)
#> [1] "0x5610e28b0a58"