| Title: | Interface for the 'Finnish Biodiversity Information Facility'API |
| Version: | 0.9.11 |
| Description: | A programmatic interface to the 'Finnish Biodiversity Information Facility' ('FinBIF') API (https://api.laji.fi). 'FinBIF' aggregates Finnish biodiversity data from multiple sources in a single open access portal for researchers, citizen scientists, industry and government. 'FinBIF' allows users of biodiversity information to find, access, combine and visualise data on Finnish plants, animals and microorganisms. The 'finbif' package makes the publicly available data in 'FinBIF' easily accessible to programmers. Biodiversity information is available on taxonomy and taxon occurrence. Occurrence data can be filtered by taxon, time, location and other variables. The data accessed are conveniently preformatted for subsequent analyses. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/luomus/finbif,https://luomus.github.io/finbif/ |
| BugReports: | https://github.com/luomus/finbif/issues |
| VignetteBuilder: | knitr |
| Encoding: | UTF-8 |
| Language: | en-US |
| Depends: | R (≥ 3.5.0) |
| Imports: | digest, httr, jsonlite, lutz, utils |
| RoxygenNote: | 7.3.2 |
| Suggests: | callr, data.table, DBI, future, knitr, rmarkdown, RSQLite,testthat (≥ 3.0.0), vcr (≥ 0.6.0), webfakes |
| Config/testthat/edition: | 3 |
| X-schema.org-applicationCategory: | Biodiversity |
| X-schema.org-keywords: | api, biodiversity, biodiversity-informatics,biodiversity-information, finbif, finbif-access, occurrences,r-package, r-programming, rstats, species, specimens, taxon,taxonomy, web-services |
| X-schema.org-isPartOf: | https://species.fi |
| NeedsCompilation: | no |
| Packaged: | 2025-08-22 09:14:26 UTC; atlanci |
| Author: | Finnish Museum of Natural History - Luomus |
| Maintainer: | William K. Morris <willi@mmorris.email> |
| Repository: | CRAN |
| Date/Publication: | 2025-08-22 09:30:16 UTC |
finbif: Interface for the 'Finnish Biodiversity Information Facility' API
Description

A programmatic interface to the 'Finnish Biodiversity Information Facility' ('FinBIF') API (https://api.laji.fi). 'FinBIF' aggregates Finnish biodiversity data from multiple sources in a single open access portal for researchers, citizen scientists, industry and government. 'FinBIF' allows users of biodiversity information to find, access, combine and visualise data on Finnish plants, animals and microorganisms. The 'finbif' package makes the publicly available data in 'FinBIF' easily accessible to programmers. Biodiversity information is available on taxonomy and taxon occurrence. Occurrence data can be filtered by taxon, time, location and other variables. The data accessed are conveniently preformatted for subsequent analyses.
Package options
finbif_api_urlCharacter. The base url of the API to query. Default:
"https://api.laji.fi"finbif_api_versionCharacter. The API version to use. Default:
"v0"finbif_allow_queryLogical. Should remote API queries by allowed.Default:
TRUEfinbif_use_cacheLogical or Integer. If
TRUEor a number greaterthan zero, then data-caching will be used. If not logical then cache willbe invalidated after the number of hours indicated by the value. Default:TRUEfinbif_use_cache_metadataLogical or Integer. If
TRUEor a numbergreater than zero, then metadata-caching will be used. If not logical thencache will be invalidated after the number of hours indicated by the value.Default:TRUEfinbif_cache_pathCharacter. The path to the directory where tostore cached API queries. If unset (the default) in memory caching isused.
finbif_tzCharacter. The timezone used by
finbiffunctions thatcompute dates and times. Default:Sys.timezone()finbif_localeCharacter. One of the supported two-letter ISO 639-1language codes. Current supported languages are English, Finnish andSwedish. By default, the system settings are used to set this option ifthey are set to one of the supported languages, otherwise English is used.
finbif_hide_progressLogical. Global option to suppress progressindicators for downloading, importing and processing FinBIF records.Default:
FALSE
Author(s)
Maintainer: William K. Morriswilli@mmorris.email (ORCID)
Other contributors:
Finnish Museum of Natural History - Luomus (03tcx6c30) [copyright holder]
Finnish Biodiversity Information Facility (01c0yey93) [copyright holder]
See Also
Useful links:
Report bugs athttps://github.com/luomus/finbif/issues
Caching FinBIF downloads
Description
Working with cached data from FinBIF.
Turning caching off
By default, local caching of most FinBIF API requests is turned on. Anyrequest made using the same arguments will only request data from FinBIF inthe first instance and subsequent requests will use the local cache while itexists. This will increase the speed of repeated requests and save bandwidthand computation for the FinBIF server. Caching can be turned off temporarilyby settingcache = c(FALSE, FALSE) in the requesting function.
Settingoptions(finbif_use_cache = FALSE, finbif_use_cache_metadata = FALSE) willturn off caching for the current session.
Using filesystem caching
By default cached requests are stored in memory. This can be changed bysetting the file path for the current session withoptions(finbif_cache_path = "path/to/cache").
Using database caching
Caching can also be done using a database. Using a database for cachingrequires theDBI package and a database backend package such asRSQLiteto be installed. To use the database for caching simply pass the connectionobjected created withDBI::dbConnect to thefinbif_cache_path option(e.g.,db <- DBI::dbConnect(RSQLite::SQLite(), "my-db.sqlite");options(finbif_cache_path = db)).
Timeouts
A cache timeout can be set by using an integer (number of hours until cacheis considered invalid and is cleared) instead of a logical value for thefinbif_use_cache andfinbif_use_cache_metadata options or thecachefunction arguments.
Clearing the cache
The cache can be resetfinbif_clear_cache().
Updating the cache
The cache can be updated usingfinbif_update_cache().
Filtering FinBIF records
Description
Filters available for FinBIF records and occurrence data.
Taxa
Filters related to taxa include:
taxon_idCharacter vector.FinBIF taxon IDs. The functionsfinbif_check_taxa()andfinbif_taxa()can be used to search for taxon IDs.taxon_nameCharacter vector.Filter based on taxon names (scientific or common) rather than IDs. If thespecified taxa are not found in the FinBIF taxonomy then matches areattempted with the occurrence record names as originally supplied verbatim.quality_controlled_detLogical.IfTRUE(default) use quality controlled taxonomic determinations. Or, ifFALSEuse the originally recorded taxonomic determinations.subtaxaLogical.IfTRUE(default) return records of all taxa belonging to specified taxa.Or, ifFALSEonly return records for exact matches to the specified taxa(e.g., if a genus is specified, do not return records of the speciesbelonging to the genus, return records of individuals identified as thatgenus only and not identified to a lower taxonomic level).invalid_taxaLogical.IfTRUE(default) return records for taxa not found in the FinBIFtaxonomic database as well as taxa that are in the FinBIF database. Or, ifFALSElimit records to only those of taxa found in the FinBIF database.informal_groupsCharacter vector.Filter by informal taxonomic groups. Only including informal groups linkedto the recorded taxa in the FinBIF database. Use the functionfinbif_informal_groups()to see the informal taxonomic groups availablein FinBIF.informal_groups_reportedCharacter vector.Filter by informal taxonomic groups including groups reported directly withthe record and those linked to the recorded taxa in the FinBIF database.Use the functionfinbif_informal_groups()to see the informal taxonomicgroups available in FinBIF.regulatory_statusCharacter vector.Filter by regulatory status code. Use the functionfinbif_metadata()to see regulatory statuses and codes.red_list_statusCharacter vector.Filter by IUCN red list status code. Use the functionfinbif_metadata()to see red list statuses and codes.primary_habitatCharacter vector or named list of character vectors.Filter by primary habitat code. Use the functionfinbif_metadata()to see habitat (sub)types and codes for taxa in the FinBIF database.Habitat type/subtypes can be refined further by indicating habitatqualifiers with a named list of character vectors where the names arehabitat (sub)type codes and the elements of the character vector are thehabitat qualifier codes. Use the functionfinbif_metadata()tosee habitat qualifiers and codes. The records returned will be of taxawhose primary habitat is considered to be the (sub)habitat/habitatqualifier combination supplied.primary_secondary_habitatCharacter or named list of character vectors.As above, except the records returned will be of taxa whose primary orsecondary habitat is considered to be the combination supplied.finnish_occurrence_statusCharacter vector.Filter by Finnish occurrence status of taxa. Usefinbif_metadata()to see the possible occurrencestatuses of taxa.finnish_occurrence_status_negCharacter vector.Negation of the above. Selecting a status will filter out rather thaninclude records with the selected status.finnishLogical.IfTRUE, limit records to taxa thought to occur in Finland. Or ifFALSElimit to taxa not thought to occur in Finland. If unspecified (default)return records of all taxa.invasiveLogical.IfTRUE, limit records to invasive taxa. Or ifFALSElimit tonon-invasive taxa. If unspecified (default) return records of invasive andnon-invasive taxa.taxon_rankCharacter vector.Filter by taxonomic rank. Usefinbif_metadata()to see the taxonomicranks available. Records returned will be limited to the specified ranksand not include records of lower taxonomic levels.
Location
Filters related to location of record include:
localityCharacter vector.Filter by name of locality. Will first try to match strings to thecountries, bio-provinces, and municipalities (see below) in FinBIF, if noneof these locality types match exactly then will return records withverbatim locality matches in the original records.countryCharacter vector.Filter by country. Usefinbif_metadata()to see country names and ISOcodes (2 and 3 character) used in FinBIF.regionCharacter vector.Filter by region. Usefinbif_metadata()to see region names and codes.bio_provinceCharacter vector.Filter by bio-province. Usefinbif_metadata()to see bio-province namesand codes.finnish_municipalityCharacter vector.Filter by municipality. Usefinbif_metadata()to see Finnish municipalitynames.location_tagCharacter vectorFilter by tags associated with a location (e.g.,"farmland").bird_assoc_areaCharacter vector.Filter by BirdLife Finland association area. Usefinbif_metadata()to see association names and codes.coordinatesCoordinates.A character vector or list of coordinate data. Must be length 3 to 4 (e.g.,list(lat = c(60.4, 61), lon = c(22, 22.5), system = "wgs84", ratio = 1).The first element is minimum and maximum latitude and the second minimumand maximum longitude (or can be minimums only). The third element is thecoordinate system; either one of"wgs84","euref"or"ykj". Theoptional fourth element is a positive value less than1. When1, thecoverage area of the returned records will be completely within the boxbound by the coordinates values. Values less than1requires the returnedrecord's coverage to overlap with the bounding box in that proportion. Whenusing the system "ykj" the coordinates will be coerced to integers withunits inferred from the number of integer digits (7 digits equals kms, 6equals 10kms, etc.,). If coordinate maximums are not specified they willbe assumed to be one unit above the minimums (e.g.,c(666, 333, "ykj")isequivalent tolist(c(6660000, 6670000), c(3330000, 3340000), "ykj")).coordinates_centerCoordinates.A character vector or list of coordinate data. Must be of length 3. Thefirst two elements are latitude and longitude and third is the coordinatesystem (currently only"wgs84"is implemented). Records returned will bethose for which the center point exactly matches that which is specified.coordinates_cell_{1k|10k|50k|100k}Coordinates.A vector of coordinate data (lat, lon). Filter by grid cell at scale*.Where*is 1, 10, 50 or 100. The coordinates specify the southeast cornerof the cell. Coordinates system is"ykj".coordinates_cell_{1k|10k|50k|100k}_centerCoordinates.As above, except coordinates indicate center of grid cell.coordinates_sourceCharacter.Filter by source of coordinates. Currently accepted values are"reported_value"(coordinates were recorded at time of observation) and"finnish_municipality"(coordinates were derived and observer onlyrecorded Finnish municipality).coordinates_uncertainty_maxInteger.Filter by maximum uncertainty of coordinates (i.e.,coordinates_uncertainty_max = 100will return records that are accurateto 100m).
Time
Filters related to time of record include:
date_range_ymdDates.A vector of one to twoDate objects (begin and enddates) or objects that are coercible to theDate. Whensupplying dates as strings, the day or month-and-day can be omitted (e.g.,"2001-04"or"2001"). Note however, that when omitting day, only "-"is allowed to separate year and month, and months must be intwo-digit/leading zero form. If the begin or end dates are partial datestrings they will be interpreted as the first or last day of the month oryear (e.g.,c(2001, 2003)is equivalent toc("2001-01-01", "2003-12-12")). If a single date is supplied as a partialdate string then all records that fall within that month or year will bereturned (e.g.,c("2001-01")is equivalent toc("2001-01-01", "2001-01-31")). Use empty strings for the begin or enddate to specify open-ended date ranges (e.g.,c("2000-01-01", "")for alldates from the turn of the century).date_range_ymDates.As above, but days (if supplied) will be ignored.date_range_dInteger vector.Filter by day of the year (e.g.,1to366). If begin or end date isomitted then it is interpreted as the first or last day of the year.date_range_mdCharacter vector.Filter by month and day of the year (e.g.,"01-01"to"12-31"). Ifbegin or end date is omitted then it is interpreted as the first or lastday of the year.{first|last}_import_date_{min|max}Date.Filter by date record was imported/modified. Either aDate object or object that is coercible to theDate class, or the number of seconds since 1970-01-0100:00.00 UTC (the so-called UNIX epoch). Note that this means thatspecifying a year, such as 2019, without a month and day will beinterpreted as 2019 seconds after midnight on Jan 1, 1970 and not the year2019.
Quality
Filters related to quality of record:
quality_issues. Character.Filter by the presence of record quality issues. One of"without_issues","with_issues"or"both". Issues include any quality issues with therecord, the event, or the document. The default is"without_issues"unless filtering by record, event or document ID or record annotationstatus.requires_verificationLogical.Show only records requiring verification (TRUE) or not requiringverification (FALSE).collection_qualityCharacter vector.Filter by one or more collection quality types. Must be one of"professional","hobbyist"or"amateur".record_reliabilityCharacter vector.Filter by the reliability of the record. Must be one or more of"reliable","unassessedor"unreliable". Default isc("reliable", "unassessed").record_qualityCharacter vector.Filter by the quality of the record. Must be one or more of"expert_verified","community_verified","unassessed","uncertain",or"erroneous".
Misc
Other filters:
keywordsCharacter vector.Filter by keywords.collectionCharacter vector orfinbif_collections()data.frame.Filter by collection. If a character vector can refer to collection ID,collection name (in English) or abbreviated name.Usefinbif_collections()to see list of collections and metadata. Canalso use the results of a call tofinbif_collections()directly tofilter records.subcollectionsLogical.IfTRUE(default) include the subcollections of the collectionsspecified. IfFALSEdo not include subcollections.not_collectionCharacter vector orfinbif_collections()data.frame.As forcollection, but result will be the negation of the specifiedcollections.sourceCharacter vector.Filter by information system data source. Usefinbif_metadata()to seedata source IDs names and descriptions.record_basisCharacter vector.Filter by basis of record. Usefinbif_metadata()to see list ofrecord bases.superrecord_basisCharacter vector.Filter by superset of record basis. One or more of"human_observation","machine_observation", or"specimen".life_stageCharacter vector.Filter by organism life stage. Usefinbif_metadata()to see list oforganism life stages.sexCharacter vector.Filter by organism sex and sex-related category name or code. Usefinbif_metadata()to see list of organism sexes and sex-relatedcategories and codes. If"male"or"female"is specified then recordsreturned will be those with sex specified as male or female respectivelyand those records where the corresponding{male|female}_abundance > 1.event_idCharacter.Filter by event (list of records, etc.) ID.document_idCharacter.Filter by the document (collection of events) ID of occurrences.record_idCharacter.individual_idCharacter.Filter by individual (an individual organism) ID.abundance_minInteger.Filter by the minimum number of individual organisms in the record.abundance_maxInteger.Filter by the maximum number of individual organisms in the record.type_specimenLogical.Filter by whether or not the record is a type specimen.wild_statusCharacter.Filter by "wildness" status of records. One or more of"wild","non_wild"or"unknown". Default isc("wild", "unknown").is_breeding_locationLogical.Filter by whether or not the occurrence is recorded at a known breedinglocation.has_document_mediaLogical.Filter by whether there is media (images, video, audio, etc.) associatedwith the records' document.has_event_mediaLogical.Filter by whether there is media (images, video, audio, etc.) associatedwith the records' event.has_record_mediaLogical.Filter by whether there is media (images, video, audio, etc.) associatedwith the record.has_mediaLogical.Filter by whether there is any media (images, video, audio, etc.)associated with the record, its document or its event.event_observer_nameCharacter.Filter by observer name.event_observer_idInteger.Filter by observer ID.restriction_reasonCharacter vector.Filter by reason data has security restrictions. Seefinbif_metadata()for a list of reasons data may have securityrestrictions.restriction_levelCharacter vector.Filter by data restriction level. Seefinbif_metadata()for a list of the levels of datarestrictions.restrictedLogical.Filter records by whether any data restrictions are in place (TRUE) ornot (FALSE).annotatedLogical.Filter records that do (TRUE) or do not (FALSE) have annotations.unidentifiedLogical.Filter by whether the record has been identified to species level andlinked to the FinBIF taxon database (FALSE) or has not been identified tospecies level reliably and linked to the taxon database (TRUE).taxon_censusCharacter vector.Return records belonging to surveys or censuses of a given taxon ortaxonomic group. Specify the taxonomic group with a FinBIF taxon ID. Usefinbif_check_taxa()to find taxon IDs.{record|event|document}_factCharacter vector.Filter by record, event or document facts. Facts are key-value pairs of theform"<fact>=<value>". Value can be omitted in which case all recordswith any value recorded for the specified fact will be returned.has_sampleLogical.Record includes a sample or samples (e.g., a DNA sample or preparation).complete_list_typeFilter by complete list type. Records made duringmonitoring that produces taxon lists for a given group of taxa (e.g.,birds) can include all species observed with breeding status recorded foreach observed species (all_species_and_breeding), all species observedwithout breeding status recorded for all species observed, all speciesobserved with or without breeding status recorded for all observed species(all_species), or only some of the species observed (incomplete).complete_list_taxon_idFilter by the taxon ID of the target group (e.g.,birds) for a complete list.
Check FinBIF taxa
Description
Check that taxa are in the FinBIF database.
Usage
finbif_check_taxa(taxa, cache = getOption("finbif_use_cache"))Arguments
taxa | Character (or list of named character) vector(s). If a list eachvector can have the name of a taxonomic rank (genus, species, etc.,).The elements of the vectors should be the taxa to check. |
cache | Logical or Integer. If |
Value
An object of classfinbif_taxa. A list with the same form astaxa.
Examples
## Not run: # Check a scientific namefinbif_check_taxa("Cygnus cygnus")# Check a common namefinbif_check_taxa("Whooper swan")# Check a genusfinbif_check_taxa("Cygnus")# Check a list of taxafinbif_check_taxa( list( species = c("Cygnus cygnus", "Ursus arctos"), genus = "Betula" ))## End(Not run)Clear cache
Description
Remove cached FinBIF API requests.
Usage
finbif_clear_cache()Examples
## Not run: finbif_clear_cache()## End(Not run)FinBIF collections
Description
Get information on collections in the FinBIF database.
Usage
finbif_collections( filter, select, subcollections = TRUE, supercollections = FALSE, locale = getOption("finbif_locale"), nmin = 0, cache = getOption("finbif_use_cache_metadata"))Arguments
filter | Logical. Expression indicating elements or rows to keep:missing values are taken as false. |
select | Expression. Indicates columns to select from the data frame. |
subcollections | Logical. Return subcollection metadata of higher levelcollections. |
supercollections | Logical. Return lowest level collection metadata. |
locale | Character. Language of data returned. One of "en", "fi", or"sv". |
nmin | Integer. Filter collections by number of records. Only returninformation on collections with greater than value specified. If |
cache | Logical or Integer. If |
Value
A data.frame.
Examples
## Not run: # Get collection metadatacollections <- finbif_collections()## End(Not run)FinBIF informal groups
Description
Display the informal taxonomic groups used in the FinBIF database.
Usage
finbif_informal_groups( group, limit = 5, quiet = FALSE, locale = getOption("finbif_locale"), cache = getOption("finbif_use_cache_metadata"))Arguments
group | Character. Optional, if supplied only display this top-levelgroup and its subgroups. |
limit | Integer. The maximum number top-level informal groups (and theirsub-groups) to display. |
quiet | Logical. Return informal group names without displaying them. |
locale | Character. One of the supported two-letter ISO 639-1 languagecodes. Current supported languages are English, Finnish and Swedish. Fordata where more than one language is available the language denoted by |
cache | Logical or Integer. If |
Value
A character vector (invisibly).
Examples
## Not run: # Display the informal taxonomic groups used by FinBIFfinbif_informal_groups()## End(Not run)Get last modified date for FinBIF occurrence records
Description
Get last modified date for filtered occurrence data from FinBIF.
Usage
finbif_last_mod(..., filter)Arguments
... | Character vectors or list of character vectors. Taxa of recordsto download. |
filter | List of named character vectors. Filters to apply to records. |
Value
ADate object
Examples
## Not run: # Get last modified date for Whooper Swan occurrence records from Finlandfinbif_last_mod("Cygnus cygnus", filter = c(country = "Finland"))## End(Not run)FinBIF metadata
Description
Display metadata from the FinBIF database.
Usage
finbif_metadata( which, locale = getOption("finbif_locale"), cache = getOption("finbif_use_cache_metadata"))Arguments
which | Character. Which category of metadata to display. Ifunspecified, function returns the categories of metadata available. |
locale | Character. One of the supported two-letter ISO 639-1 languagecodes. Current supported languages are English, Finnish and Swedish. Fordata where more than one language is available the language denoted by |
cache | Logical or Integer. If |
Value
A data.frame.
Examples
## Not run: finbif_metadata("red_list")## End(Not run)Download FinBIF occurrence records
Description
Download filtered occurrence data from FinBIF as adata.frame.
Usage
finbif_occurrence( ..., filter = NULL, select = NULL, order_by = NULL, aggregate = "none", sample = FALSE, n = 10, page = 1, count_only = FALSE, quiet = getOption("finbif_hide_progress"), cache = getOption("finbif_use_cache"), dwc = FALSE, date_time_method = NULL, check_taxa = TRUE, on_check_fail = c("warn", "error"), tzone = getOption("finbif_tz"), locale = getOption("finbif_locale"), seed = NULL, drop_na = FALSE, aggregate_counts = TRUE, exclude_na = FALSE, unlist = FALSE, facts = NULL, duplicates = FALSE, filter_col = NULL, restricted_api = NULL)Arguments
... | Character vectors or list of character vectors. Taxa of recordsto download. |
filter | List of named character vectors. Filters to apply to records. |
select | Character vector. Variables to return. If not specified, adefault set of commonly used variables will be used. Use |
order_by | Character vector. Variables to order records by before theyare returned. Most, though not all, variables can be used to order recordsbefore they are returned. Ordering is ascending by default. To return indescending order append a |
aggregate | Character. If |
sample | Logical. If |
n | Integer. How many records to download/import. |
page | Integer. Which page of records to start downloading from. |
count_only | Logical. Only return the number of records available. |
quiet | Logical. Suppress the progress indicator for multipagedownloads. Defaults to value of option |
cache | Logical or Integer. If |
dwc | Logical. Use Darwin Core (or Darwin Core style) variable names. |
date_time_method | Character. Passed to |
check_taxa | Logical. Check first that taxa are in the FinBIF database.If true only records that match known taxa (have a valid taxon ID) arereturned. |
on_check_fail | Character. What to do if a taxon is found not valid. Oneof |
tzone | Character. If |
locale | Character. One of the supported two-letter ISO 639-1 languagecodes. Current supported languages are English, Finnish and Swedish. Fordata where more than one language is available the language denoted by |
seed | Integer. Set a seed for randomly sampling records. |
drop_na | Logical. A vector indicating which columns to check formissing data. Values recycled to the number of columns. Defaults to allcolumns. |
aggregate_counts | Logical. Should count variables be returned whenusing aggregation. |
exclude_na | Logical. Should records where all selected variables havenon-NA values only be returned. |
unlist | Logical. Should variables that contain non atomic data beconcatenated into a string separated by ";"? |
facts | Character vector. Extra variables to be extracted from record,event and document "facts". |
duplicates | Logical. If |
filter_col | Character. The name of a column, with values derived fromthe names of the filter sets used when using multiple filters, to includewhen using multiple filter sets. If |
restricted_api | Character. If using a restricted data API token inaddition to a personal access token, a string indicating the name of anenvironment variable storing the restricted data API token. |
Value
Adata.frame. Ifcount_only = TRUE an integer.
Examples
## Not run: # Get recent occurrence data for taxonfinbif_occurrence("Cygnus cygnus")# Specify the number of recordsfinbif_occurrence("Cygnus cygnus", n = 100)# Get multiple taxafinbif_occurrence("Cygnus cygnus", "Ursus arctos")# Filter the recordsfinbif_occurrence( species = "Cygnus cygnus", filter = list(coordinate_accuracy_max = 100))## End(Not run)Load FinBIF occurrence records from a file
Description
Load occurrence data from a file as adata.frame.
Usage
finbif_occurrence_load( file, select = NULL, n = -1, count_only = FALSE, quiet = getOption("finbif_hide_progress"), cache = getOption("finbif_use_cache"), dwc = FALSE, date_time_method = NULL, tzone = getOption("finbif_tz"), write_file = tempfile(), dt = NA, keep_tsv = FALSE, facts = list(), type_convert_facts = TRUE, drop_na = FALSE, drop_facts_na = drop_na, locale = getOption("finbif_locale"), skip = 0)Arguments
file | Character or Integer. Either the path to a Zip archive ortabular data file that has been downloaded from "laji.fi", a URIlinking to such a data file (e.g.,https://tun.fi/HBF.49381) or an integerrepresenting the URI (i.e., |
select | Character vector. Variables to return. If not specified, adefault set of commonly used variables will be used. Use |
n | Integer. How many records to import. Negative and other invalidvalues are ignored causing all records to be imported. |
count_only | Logical. Only return the number of records available. |
quiet | Logical. Suppress the progress indicator for multipagedownloads. Defaults to value of option |
cache | Logical or Integer. If |
dwc | Logical. Use Darwin Core (or Darwin Core style) variable names. |
date_time_method | Character. Passed to |
tzone | Character. If |
write_file | Character. Path to write downloaded zip file to if |
dt | Logical. If package, |
keep_tsv | Logical. Whether to keep the TSV file if |
facts | List. A named list of "facts" to extract from supplementary"fact" files in a local or online FinBIF data archive. Names can includeone or more of |
type_convert_facts | Logical. Should facts be converted from characterto numeric or integer data where applicable? |
drop_na | Logical. A vector indicating which columns to check formissing data. Values recycled to the number of columns. Defaults to allcolumns. |
drop_facts_na | Logical. Should missing or "all |
locale | Character. One of the supported two-letter ISO 639-1 languagecodes. Current supported languages are English, Finnish and Swedish. Fordata where more than one language is available the language denoted by |
skip | Integer. The number of lines of the data file to skip beforebeginning to read data (not including the header). |
Value
Adata.frame, or ifcount_only = TRUE an integer.
Examples
## Not run: # Get occurrence datafinbif_occurrence_load(49381)## End(Not run)Get a FinBIF personal access token
Description
Have a personal access token for use with the FinBIF API sent to a specifiedemail address.
Usage
finbif_request_token(email, quiet = FALSE)Arguments
email | Character. The email address to which to send the API accesstoken. |
quiet | Logical. Suppress messages. |
Value
If an access token has already been set thenNULL (invisibly) ifnot then, invisibly, afinbif_api object containing the response fromthe FinBIF server.
Examples
## Not run: # Request a token for example@email.comfinbif_request_token("example@email.com")## End(Not run)Search the FinBIF taxa
Description
Search the FinBIF database for taxon.
Usage
finbif_taxa( name, n = 1, type = c("exact", "partial", "likely"), cache = getOption("finbif_use_cache"))common_name(name, locale = getOption("finbif_locale"))scientific_name(name)taxon_id(name)Arguments
name | Character. The name or ID of a taxon. Or, for functions otherthan |
n | Integer. Maximum number of matches to return. For types "exact" and"likely" only one taxon will be returned. |
type | Character. Type of match to make. Must be one of |
cache | Logical or Integer. If |
locale | Character. One of the supported two-letter ISO 639-1 languagecodes. Current supported languages are English, Finnish and Swedish. Fordata where more than one language is available the language denoted by |
Value
Forfinbif_taxa afinbif_taxa object. Otherwise, a charactervector.
Examples
## Not run: # Search for a taxonfinbif_taxa("Ursus arctos")# Use partial matchingfinbif_taxa("Ursus", n = 10, "partial")# Get Swedish name of Eurasian Eagle-owlcommon_name("Bubo bubo", "sv")# Get scientific name of "Otter"scientific_name("Otter")# Get taxon identifier of "Otter"taxon_id("Otter")## End(Not run)Update cache
Description
Update all cached FinBIF API requests.
Usage
finbif_update_cache()Examples
## Not run: finbif_update_cache()## End(Not run)Convert variable names
Description
Convert variable names to Darwin Core or FinBIF R package native style.
Usage
to_dwc(...)to_native(...)from_schema(..., to = c("native", "dwc"), file = c("none", "citable", "lite"))Arguments
... | Character. Variable names to convert. For |
to | Character. Type of variable names to convert to. |
file | Character. For variable names that are derived from a FinBIFdownload file which type of file. |
Value
Character vector.
Examples
to_dwc("record_id", "date_time", "scientific_name")FinBIF record variables
Description
FinBIF record variables that can be selected in a finbif occurrence search.
Identifiers
All identifiers are returned in the form of a URI. Identifiers include:
record_idCharacter.The ID of a record of organism's occurrence at a time and place.individual_idCharacter.ID of an individual organism (e.g., a ringed bird that has been capturedmultiple times will have a singleindividual_idand multiplerecord_idscorresponding to each capture).event_idCharacter.Event ID. An event can contain one or more records (e.g., a survey ofplants at a particular location and time.)document_idCharacter.Document ID. A set of events that share common metadata.form_idCharacter.Form ID. The form used to create the document, event, record data.collection_idCharacter.Collection ID. All documents, events, and records belong to a collection(e.g., a museum collection, or the datasets collected by a specificinstitution). Collections themselves can be part of a larger(super)collection (e.g., all the collections at a specific museum). Onlythe lowest level collection ID for a record is returned. Usefinbif_collections()to explore the hierarchy of collections.source_idCharacter.Source ID. The source of the collection's data.
Taxa
Variables related to taxonomy of records include:
taxon_idCharacter.The taxon ID in the form of a URI.orig_taxon_idCharacter.The taxon ID before (if any) annotation.annotated_taxon_idCharacter.The new taxon ID if the record has had it's taxonomy annotated.reported_taxon_idCharacter.The taxon ID as originally reported by the record creator.scientific_nameCharacter.Scientific name of taxon.orig_scientific_nameCharacter.The scientific name before (if any) annotation.scientific_display_nameCharacter.Scientific name of taxon formatted for display (e.g., taxa with genus onlywill be formatted asGenus sp.).orig_scientific_display_nameCharacter.Scientific display name before (if any) annotation.common_nameCharacter.Common (vernacular) name of taxon.orig_common_nameCharacter.Common name before (if any) annotation.reported_nameCharacter.The name of the taxon as originally reported by the record creator.scientific_name_italicisedLogical.Is the scientific name normally italicised (i.e., is the taxonomic rankgenus or below.)orig_scientific_name_italicisedLogical.Is the original scientific name normally italicised.scientific_name_authorCharacter.The authority for the taxon scientific name.orig_scientific_name_authorCharacter.The authority for the taxon scientific name before (if any) annotation.reported_authorCharacter.The authority of the taxon as originally reported by the record creator.taxon_rankCharacter.The taxonomic rank of the taxon.orig_taxon_rankCharacter.The taxonomic rank of the taxon before (if any) annotation.informal_groupsList.The informal taxonomic groups that the taxon belongs to (e.g., birds) inthe form of URIs.orig_informal_groupsList.The informal taxonomic groups that the taxon belonged to before (if any)annotation.reported_informal_groupsList.The informal taxonomic groups that the taxon belongs to as reported by therecord creator.taxon_checklistCharacter.The checklist (as a URI) that that taxon is found in.orig_taxon_checklistCharacter.The checklist (as a URI) that that taxon was found in before (if any)annotation.taxon_finnishLogical.Is the taxon considered Finnish. The definition of a Finnish taxon differsby taxonomic group?orig_taxon_finnishLogical.Was the taxon considered Finnish before (if any) annotation?
Abundance, sex & life history
Variables related to abundance, sex and life history include:
abundanceInteger.Number of individuals recorded.abundance_interpretedInteger.Number of individuals recorded or inferred from the record. Note that manyrecords withabundance_interpreted == 1Lonly indicate the record is ofone individual and may not necessarily imply that this was the abundance atthat specified place and time (e.g., a preserved museum specimen consistingof a single individual).{female|male}_abundanceInteger.Number of female or male individuals recorded.pair_abundanceInteger.Number of mating pairs recorded.abundance_verbatimCharacter.The abundance as reported by the record creator.life_stageCharacter.Life stage of individual(s) recorded.sexCharacter.Sex of individual(s) recorded.
Location
Variables related to the location of records include:
{lat|lon}_{euref|wgs84}Numeric.Coordinates (inEUREF orWGS84 coordinate system)of the central point of a bounding box encompassing the record's geographiccoverage.{lat|lon}_{min|max}_{euref|ykj|wgs84}. Numeric.Vertices of a bounding box encompassing the record's geographic coverage.Coordinates are available inEUREF,YKJ, orWGS84.coordinates_uncertaintyInteger.The horizontal distance (in meters) from the record's given coordinatesdescribing the smallest circle containing the whole of the record'slocation.coordinates_sourceCharacter.Source of coordinates.footprint_{euref|ykj|wgs84}Character.Well-Known Text (WKT) representation of the geographic shape defining thelocation of the record in either EUREF, YKJ or WGS84 coordinate systems.countryCharacter.The country of the record's location.regionCharacter.The administrative area directly below the level of country.bio_provinceCharacter.For data from Finland FinBIF uses the concept ofBiogeographical Province. See link fordetails.municipality. Character.Administrative level below regionhigher_geographyCharacter.Geographic place name that is at higher level than country.line_length_mInteger.The length of linear locations (e.g., line transect surveys).area_m2Integer.The size of record's location in meters squared.is_breeding_locationLogical.Whether or not the occurrence is recorded at a known breeding location.location_idCharacter.A location ID in the form of a URI.sectionInteger.A numeric identifier for a sub-location of a location (e.g., a specificpart of a transect that undergoes repeated surveys.)
Time
Variables related to time of record include:
date_timePOSIXct.The date and time of the recording event. This variable is computed afterrecords are downloaded from FinBIF. Its timezone and accuracy can becontrolled seefinbif_occurrence()for details.durationDuration.The duration of the recording event. This variable is computed afterrecords are downloaded from FinBIF.date_startCharacter.The date the recording event began.date_endCharacter.The date the recording event ended.hour_startInteger.The hour (24 hour time) of the day the recording event began.hour_endInteger.The hour (24 hour time) of the day the recording event ended.minute_startInteger.The minute of the hour the recording event began.minute_endInteger.The minute of the hour the recording event started.ordinal_day_startInteger.The ordinal day of the year the recording event began.ordinal_day_endInteger.The ordinal day of the year the recording event endedseason_startInteger.The day of the year the recording event began. A four digit numberindicating the day of the year in MMDD (%m%d) format.season_endInteger.The day of the year the recording event ended. A four digit numberindicating the day of the year in MMDD (%m%d) format.centuryInteger.The century during which the recording event occurred (NAif the eventspans multiple centuries).decadeInteger.The decade during which the recording event occurred (NAif the eventspans multiple decades).yearInteger.The year during which the recording event occurred (NAif the event spansmultiple years).monthInteger.The month of the year during which the recording event occurred (NAifthe event spans multiple months).dayInteger.The day of the month during which the recording event occurred (NAif theevent spans multiple days).formatted_date_timeCharacter.Date and time of the recording event formatted for display.date_createdCharacter.The date the original data was created.first_load_dateCharacter.The date the record was first loaded into the FinBIF database.modified_dateCharacter.The most recent date the original data was modified.load_dateCharacter.The most recent date the record was loaded into the FinBIF database.
Data restrictions
Variables related to restricted records include:
restrictionLogical.Has the record been restricted in some way (e.g., geospatially aggregated).restriction_levelCharacter.What level of restriction has been applied to the record.restriction_reasonList.List of reasons restriction has been applied.
Data quality
Variables related to the quality of records include:
any_issuesLogical.Are there any data quality issues associated with the record, its event ordocument.reported_taxon_confidenceReliability of the record's taxonomic identification as reported by theoriginal data author.{document|time|location|event|record}_issueCharacter.Issues with record associated with its document, time, location, event, orthe record itself.{document|time|location|event|record}_issue_messageCharacter.Details about the issue.{document|time|location|event|record}_issue_sourceCharacter.Source determining the issue.requires_verificationLogical.Has the record been flagged for expert verification?requires_identificationLogical.Has the record been flagged for expert identification?record_reliabilityCharacter.Indication of the record's reliability.record_qualityCharacter.Indication of the record's quality.
Misc
Other variables:
collectionCharacter.Collection name. All documents, events, and records belong to a collection(e.g., a museum collection, or the datasets collected by a specificinstitution). Collections themselves can be part of a larger(super)collection (e.g., all the collections at a specific museum). Onlythe lowest level collection name for a record is returned. Usefinbif_collections()to explore the hierarchy of collections.observers_idsList.List of observer identifiers for the record.determinerCharacter.Person who determined the taxonomic identification of the record.record_basisCharacter.The type of or method used to obtain the record.superrecord_basisCharacter.Higher level type of or method used to obtain the record.type_specimenLogical.Whether or not the record is of a type specimen.is_wildLogical.Whether or not the record is of a "wild" organism.licenseCharacter.The license of the data associated with the record.{document|event|record}_notesCharacter.Notes associated with the document, event or record itself.{document|record}_keywordsList.List of keywords associated with the document or record.record_annotation_countInteger.How many annotations are associated with the record.sample_countInteger.How many material samples (DNA extractions, etc., ...) are associated withthe record.{document|event|record}_media_countInteger.How many media items (images, audio, video, etc., ...) are associated withthe record's document, event or the record itself.