# S3 method for stars
c(
...,
along = NA_integer_,
try_hard = FALSE,
nms = names(list(...)),
tolerance = sqrt(.Machine$double.eps)
)
Value
a single stars object with merged (binded) arrays.
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
along_crs
logical; if TRUE, combine arrays along a CRS dimension
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
tolerance
numeric; values used in all.equal to compare dimension values
combine those that dimensions matching to the first array
Details
An error is raised when attempting to combine arrays with different
measurement units into a single array. If this was intentded, drop_units
can be used to remove units of a stars object before merging.
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 dimensionc(x, x, along = 3)