set_locality | R Documentation |
Locality information refers to a description of a place, rather than a
spatial coordinate. This function helps to format columns
with locality information to a tibble
using Darwin Core Standard.
In practice this is used no differently from mutate()
, but gives some
informative errors, and serves as a useful lookup for fields in
the Darwin Core Standard.
set_locality(
.df,
continent = NULL,
country = NULL,
countryCode = NULL,
stateProvince = NULL,
locality = NULL,
.keep = "unused"
)
.df |
A |
continent |
(string) Valid continent. See details. |
country |
Valid country name. See |
countryCode |
Valid country code. See |
stateProvince |
A sub-national region. |
locality |
A specific description of a location or place. |
.keep |
Control which columns from .data are retained in the output.
Note that unlike |
Values of continent
should be one of "Africa"
, "Antarctica"
, "Asia"
,
"Europe"
, "North America"
, "Oceania"
or "South America"
.
countryCode
should be supplied according to the
ISO 3166-1 ALPHA-2
standard, as per TDWG advice.
Examples of countryCode
:
AUS
NZ
BRA
Examples of locality
:
Bariloche, 25 km NNE via Ruta Nacional 40 (=Ruta 237)
Queets Rainforest, Olympic National Park
A tibble
with the requested columns added/reformatted.
set_coordinates()
for numeric spatial data.
df <- tibble::tibble(
scientificName = c("Crinia Signifera", "Crinia Signifera", "Litoria peronii"),
latitude = c(-35.27, -35.24, -35.83),
longitude = c(149.33, 149.34, 149.34),
eventDate = c("2010-10-14", "2010-10-14", "2010-10-14"),
countryCode = c("AU", "AU", "AU"),
state = c("New South Wales", "New South Wales", "New South Wales"),
locality = c("Melville Caves", "Melville Caves", "Bryans Swamp about 3km away")
)
# Reformat columns to Darwin Core Standard terms
df |>
set_locality(
countryCode = countryCode,
stateProvince = state,
locality = locality
)
# Columns with valid Darwin Core terms as names are automatically detected
# and checked. This will do the same as above.
df |>
set_locality(
stateProvince = state
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.