R/sbdi_fields.R
sbdi_fields.Rd
Note for occurrence fields: only fields that are indexed in the SBDI database can be queried (e.g. used in the fq
parameter in occurrences
. These fields are identified by the indexed
column in sbdi_fields("occurrence")
. Only fields that are stored in the database can be returned as part of an occurrences
call. These fields are identified by the stored
column in sbdi_fields("occurrence")
. The calling syntaxes sbdi_fields("occurrence_stored")
and sbdi_fields("occurrence_indexed")
are for convenience, and are equivalent to subset(sbdi_fields("occurrence"),stored)
and subset(sbdi_fields("occurrence"),indexed)
.
sbdi_fields(fields_type, as_is = TRUE) field_info(field_id, maxrows = 50, record_count_only = FALSE)
fields_type | text: one of the following
|
---|---|
as_is | logical: if TRUE, leave the field names as they are returned from the ALA web services. Arguments that are passed
directly to the ALA's web services (e.g. parameter |
field_id | text: id of environmental/contextual layer field for which to look up information Prepend "el" for "environmental" (grided) layers and "cl" for "contextual" (polygonal) layers |
maxrows | integer: maximum number of records to download. Some contextual layers (those with |
record_count_only | logical: if TRUE, return just the count of records that would be downloaded, but don't download them. This really only makes sense for contextual layers, because environmental layers have only one record per layer |
If record_count_only
is TRUE, the number of records is returned as numeric. Otherwise, a data frame containing the field name and various attributes; an empty data frame is returned if no match is found
Relevant ALA web services:
for fields_type "occurrence": https://api.biodiversitydata.se/#ws72
for fields_type "general": https://api.biodiversitydata.se/#ws88
for fields_type "layers": https://api.biodiversitydata.se/#ws11 (see also descriptions of the spatial layers: https://spatial.biodiversitydata.se/layers/)
for fields_type "assertions": https://api.biodiversitydata.se/#ws81
search_layers
to search for spatial layers
if (FALSE) { l <- sbdi_fields("layers") l[,4] o <- sbdi_fields("occurrence") o[1:13,] a <- sbdi_fields("assertions") a$description field_info("cl22") field_info("el773") }