st_dim_to_attr: create an array with dimension values

st_dim_to_attrR Documentation

create an array with dimension values

Description

create an array with dimension values

Usage

st_dim_to_attr(x, which = seq_along(dim(x)))

Arguments

x

object of class stars

which

integer; indices of the dimensions to address (default: all)

Value

stars object with dimension values as attributes

Examples

tif = system.file("tif/L7_ETMs.tif", package = "stars")
x1 = read_stars(tif)
(x = st_dim_to_attr(x1))
plot(x)
(x = st_dim_to_attr(x1, 2:3))
plot(x)
(x= st_dim_to_attr(x1, 3))
plot(x)

stars documentation built on May 29, 2024, 8:59 a.m.