Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

c.stars

combine multiple stars objects, or combine multiple attributes in a single stars object into a single array


Description

combine multiple stars objects, or combine multiple attributes in a single stars object into a single array

Usage

## S3 method for class 'stars'
c(..., along = NA_integer_, try_hard = FALSE, nms = names(list(...)))

## S3 method for class 'stars_proxy'
c(
  ...,
  along = NA_integer_,
  along_crs = FALSE,
  try_hard = FALSE,
  nms = names(list(...))
)

Arguments

...

object(s) of class star: in case of multiple arguments, these are combined into a single stars object, in case of a single argument, its attributes are combined into a single attribute. In case of multiple objects, all objects should have the same dimensionality.

along

integer; see read_stars

try_hard

logical; if TRUE and some arrays have different dimensions, combine those that dimensions matching to the first array

nms

character; vector with array names

along_crs

logical; if TRUE, combine arrays along a CRS dimension

Examples

tif = system.file("tif/L7_ETMs.tif", package = "stars")
x = read_stars(tif)
(new = c(x, x))
c(new) # collapses two arrays into one with an additional dimension
c(x, x, along = 3)

stars

Spatiotemporal Arrays, Raster and Vector Data Cubes

v0.5-2
Apache License
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Michael Sumner [ctb] (<https://orcid.org/0000-0002-2471-7511>), Etienne Racine [ctb], Adriano Fantini [ctb], David Blodgett [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.