Converts a tibble returned by mnk_obs into an sf POINT
object. Keeps selected columns and coerces observed_on to Date
when present.
Arguments
- data
a data frame or tibble with at least
latitudeandlongitudecolumns, typically frommnk_obs().- ...
columns to retain, using tidyselect syntax.
latitudeandlongitudeare always added for geometry.- crs
coordinate reference system for the output, defaults to 4326 (WGS84).
- keep_coords
logical. If TRUE, retains
latitudeandlongitudeas regular columns in addition to geometry.
Value
an sf object with POINT geometry (EPSG:4326 by default) and the selected attributes. Returns an empty sf object if no valid coordinates are present.
See also
mnk_obs for downloading observations.
Examples
if (FALSE) { # \dontrun{
obs <- mnk_obs(taxon_name = "Parablennius pilicornis", year = 2024)
obs_sf <- mnk_obs_sf(obs, id, taxon_name, observed_on)
obs_sf
} # }
