| Title: | Download and Extract Data from the 'OzButterflies' Database |
|---|---|
| Description: | Provides tools to download and extract data from the 'OzButterflies' Database <doi:10.5281/zenodo.19019034>, which contains reflectance spectra, calibrated photographs, and cytochrome c oxidase subunit I (COI) sequences of Australian butterflies. The main function get_Oz_butterflies() downloads the database and extracts selected files to a specified directory using user-defined filters. |
| Authors: | Diogo Silva [aut, cre] (ORCID: <https://orcid.org/0000-0002-0887-2001>), Jim McLean [aut] (ORCID: <https://orcid.org/0000-0001-6229-7063>) |
| Maintainer: | Diogo Silva <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.1 |
| Built: | 2026-05-22 09:16:09 UTC |
| Source: | https://github.com/diogojackson/buttr |
Simplifies downloading the OzButterflies database (Ref) to a local folder. The function allows users to download specific subsets of the database by applying multiple filters, such as species name, genus, site, family, specific IDs, and more.
get_Oz_butterflies( species = NULL, genus = NULL, family = NULL, sex = NULL, year = NULL, site = NULL, spectra = NULL, sampleIDs = NULL, download_images = c("raw", "jpeg"), download_dna = TRUE, save_folder = NULL, timeout = 10 * 60 * 60, quiet = FALSE, db_version = NA )get_Oz_butterflies( species = NULL, genus = NULL, family = NULL, sex = NULL, year = NULL, site = NULL, spectra = NULL, sampleIDs = NULL, download_images = c("raw", "jpeg"), download_dna = TRUE, save_folder = NULL, timeout = 10 * 60 * 60, quiet = FALSE, db_version = NA )
species |
Optional vector of binomial names of species of interest. If specified, only species from this list will be included in the local database. |
genus |
If specified, only specimens from this genus will be installed. |
family |
If specified, only specimens from this family will be installed. |
sex |
If specified, only specimens of this sex ( |
year |
If specified, only specimens collected during these years will be installed (options are 2022 or 2023). |
site |
If specified, only specimens collected at these sites will be installed. |
spectra |
If specified, only specimens with the specified spectra value
will be installed ( |
sampleIDs |
If specified, only specimens with the specified IDs will be installed. |
download_images |
Specifies whether |
download_dna |
If |
save_folder |
Folder where the downloaded database will be saved. This argument must be provided by the user. |
timeout |
Maximum time allowed (in seconds) to download each file;
default is 10 hours. The time required will depend on the speed of your
Internet connection and the parts of the database that you choose to
download. If you experience an error message such as " |
quiet |
If |
db_version |
Version of the database to download. |
Be aware that downloading very large files can take many hours, depending on the speed of your Internet connection.
get_Oz_butterflies will not remove local existing files, so subsequent
calls can be used to add to the installed database.
If you receive an intermittent error such as "status was 'SSL peer certificate or SSH remote key was not OK'", try using a different download
method. ButtR downloads files by calling download.file,
so the download method can be specified by setting the download.file.method
option; for example, options(download.file.method = "curl"). See the
download.file help for further details.
The installation folder (save_folder) in canonical form in
invisible form (which means it is not automatically printed).
## Not run: # Download the full OzButterflies Database get_Oz_butterflies(save_folder = "OzButterflies") # Get data only for Delias aganippe get_Oz_butterflies(species = "Delias aganippe", save_folder = "Delias_aganippe") # Get data for all species of the genus Delias get_Oz_butterflies(genus = "Delias", save_folder = "Delias_database") # Get all species within the Nymphalidae family get_Oz_butterflies(family = "Nymphalidae", save_folder = "Nymphalidae_data") # Get raw files in .ARW format (from version 3 of the database) get_Oz_butterflies( download_images = "raw", db_version = 3, species = "Delias aganippe", save_folder = "Delias_raw_ARW" ) # Get raw files in .DNG format (from version 4 of the database) get_Oz_butterflies( download_images = "raw", db_version = 4, species = "Delias aganippe", save_folder = "Delias_raw_DNG" ) ## End(Not run)## Not run: # Download the full OzButterflies Database get_Oz_butterflies(save_folder = "OzButterflies") # Get data only for Delias aganippe get_Oz_butterflies(species = "Delias aganippe", save_folder = "Delias_aganippe") # Get data for all species of the genus Delias get_Oz_butterflies(genus = "Delias", save_folder = "Delias_database") # Get all species within the Nymphalidae family get_Oz_butterflies(family = "Nymphalidae", save_folder = "Nymphalidae_data") # Get raw files in .ARW format (from version 3 of the database) get_Oz_butterflies( download_images = "raw", db_version = 3, species = "Delias aganippe", save_folder = "Delias_raw_ARW" ) # Get raw files in .DNG format (from version 4 of the database) get_Oz_butterflies( download_images = "raw", db_version = 4, species = "Delias aganippe", save_folder = "Delias_raw_DNG" ) ## End(Not run)
Summarise contents of the locally installed OzButterflies database
Oz_butterflies_summary( save_folder = "OzButterflies", imgExt = "\\.DNG$|\\.dng$|\\.ARW$|\\.arw$" )Oz_butterflies_summary( save_folder = "OzButterflies", imgExt = "\\.DNG$|\\.dng$|\\.ARW$|\\.arw$" )
save_folder |
Path of folder that contains the OzButterflies database. |
imgExt |
Regular expression used to identify files to be counted as
images. Default is |
Data frame with 1 row and columns that summarise the database
contents. All summary statistics, apart from the Images count, describe
the entire database, regardless of whether the entire database or a subset
is installed locally.