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

st_join.stars

Spatially join a stars and an 'sf' object


Description

Spatially join a stars and an 'sf' object

Usage

## S3 method for class 'stars'
st_join(
  x,
  y,
  join = st_intersects,
  ...,
  what = "left1",
  as_points = NA,
  warn = TRUE
)

Arguments

x

object of class stars

y

object of class sf, or one that can be coerced into that by st_as_sf

join

the join function, which should return an sgbp object; see details

...

arguments that will be passed on to the join function

what

"left1", "right" or "inner"; see details

as_points

logical; controls whether grid cells in x will be treated as points, or as cell areas; the st_intersects.stars method by default will derive this from x's metadata, or else assume areas.

warn

logical; if TRUE, warn on 1-to-many matches when what is "left1"

Details

When there is more than one match to a single x value, the first matching record from y is taken (and if warn is TRUE a warning is raised). If what is "inner", an object of class sf with all matching records of x and y.

Value

If what is "left1", an object of class stars with the (first) value of y at spatial instances of x


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.