View source: R/get_Oz_butterflies.R
| get_Oz_butterflies | R Documentation |
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
)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.