The most common form of data stored by ALA are observations of
individual life forms, known as 'occurrences'. This function allows the
user to search for occurrence records that match their specific criteria,
and return them as a data.frame
for analysis. Optionally,
the user can also request a DOI for a given download to facilitate citation
and re-use of specific data resources.
atlas_occurrences(
request = NULL,
identify = NULL,
filter = NULL,
geolocate = NULL,
select = galah_select(group = "basic"),
mint_doi = FALSE,
doi = NULL,
refresh_cache = FALSE
)
optional data_rquest
object: generated by a call to
galah_call()
.
data.frame
: generated by a call to
galah_identify()
.
data.frame
: generated by a call to
galah_filter()
string
: generated by a call to
galah_geolocate()
data.frame
: generated by a call to
galah_select()
logical
: by default no DOI will be generated. Set to
TRUE
if you intend to use the data in a publication or similar
string
: this argument enables retrieval of occurrence
records previously downloaded from the ALA, using the DOI generated by the
data.
logical
: if set to TRUE
and
galah_config(caching = TRUE)
then files cached from a previous query will
be replaced by the current query
An object of class tbl_df
and data.frame
(aka a tibble) of
occurrences, containing columns as specified by galah_select()
.
The data.frame
object has the following attributes:
a listing of the user-supplied arguments of the data_request
(i.e., identify, filter, geolocate, select)
a doi
of the data download
the search_url
of the query to ALA API
Search for occurrences matching a taxon identifier
galah_config(email = "your-email@email.com") galah_call() |> galah_identify("Reptilia") |> atlas_occurrences()
Search for occurrences in a year range
galah_call() |> galah_filter(year >= 2010, year <= 2020) |> atlas_occurrences()
Search for occurrences in a WKT-specified area
polygon <- "POLYGON((146.24960 -34.05930,146.37045 -34.05930,146.37045 -34.152549,146.24960 -34.15254,146.24960 -34.05930))" galah_call() |> galah_geolocate(polygon) |> atlas_occurrences()
You can also download occurrence records by piping with %>%
if you prefer.
galah_call() %>% galah_identify("Reptilia") %>% galah_filter(year >= 2010) %>% galah_geolocate(polygon) %>% atlas_occurrences()
Note that unless care is taken, some queries can be particularly large.
While most cases this will simply take a long time to process, if the number
of requested records is >50 million the call will not return any data. Users
can test whether this threshold will be reached by first calling
atlas_counts()
using the same arguments that they intend to pass to
atlas_occurrences
(). It may also be beneficial when requesting a large
number of records to show a progress bar by setting verbose = TRUE
in
galah_config()
.