Skip to contents

Pick a specific or random entry from boundaries

Usage

pick_entry(
  boundaries,
  value = NULL,
  by = c("name", "code"),
  random = FALSE,
  seed = NULL
)

Arguments

boundaries

An sf object from ons_get_boundaries().

value

Name or code to match (optional).

by

Match by 'name' or 'code'.

random

If TRUE, pick a random entry.

seed

Optional seed for reproducibility.

Value

A list with 'selected' (sf row) and 'boundaries' (sf).