Skip to contents

Functions for coercing an object to an sf_list class objects created by vctrs::new_list_of() and checking lists of sf objects. Any function with the allow_list parameter supports this type of input.

Usage

as_sf_list(
  x,
  nm = "data",
  col = NULL,
  crs = NULL,
  clean_names = TRUE,
  .name_repair = "check_unique",
  call = caller_env()
)

new_sf_list(
  x,
  nm = "data",
  col = NULL,
  clean_names = TRUE,
  .name_repair = "check_unique",
  call = caller_env()
)

is_sf_list(x, ext = TRUE, allow_null = FALSE)

sf_list_rbind(x, ...)

map_as_sf_list(x, .f, ...)

map_as_sf(x, .f, ...)

Arguments

x

An sf, sfc, or bbox object.

nm

For as_sf_list, name(s) for sf list; defaults to "data". If col is provided, the values of the grouping column are used as names.

col

For as_sf_list, the name of the column used to group data if x is a sf object or used to group and nest data before passing to x.

clean_names

If TRUE, clean names provided to nm or created based on value of col using janitor::clean_names. If FALSE, use names as provided.

.name_repair

One of "unique", "universal", or "check_unique". See vctrs::vec_as_names() for the meaning of these options.

call

The execution environment of a currently running function, e.g. caller_env(). The function will be mentioned in error messages as the source of the error. See the call argument of abort() for more information.

ext

If TRUE, check if x is a sf, sfc, or bbox class object or not; defaults to FALSE. (used by is_sf)

allow_null

If TRUE and x is NULL, return TRUE; defaults to FALSE.

...

For sf_list_rbind(), additional parameters passed to purrr::list_rbind(). For map_as_sf(), additional parameters passed to map.

See also