nr_to_raster: Convert native raster images to/from other R objects

View source: R/conversion.R

nr_to_rasterR Documentation

Convert native raster images to/from other R objects

Description

Convert native raster images to/from other R objects

Usage

nr_to_raster(nr)

raster_to_nr(ras, dst = NULL)

nr_to_array(nr)

array_to_nr(arr, dst = NULL)

Arguments

nr

native raster image

ras

standard R raster i.e. a character matrix of hex color values

dst

destination native raster image. If NULL (the default) a new

arr

3d numeric array representing R,G,B,A values with dimensions [nrow, ncol, 4] or [nrow, ncol, 3]. Each value is in range [0,1].

Value

raster, array or native raster image

See Also

Other conversion functions: magick_to_nr(), matrix_to_nr(), nrs_to_gif(), nrs_to_mp4()

Examples

nr <- nr_new(12, 8, 'hotpink')
nr_to_raster(nr)

nr_to_array(nr)

nara documentation built on May 28, 2026, 5:07 p.m.