Downloads all photos from a data frame returned by inat_fetch(), and
optionally saves observation metadata to a CSV file in the same folder.
inat_download(
obs,
out_dir,
size = "large",
metadata = TRUE,
overwrite = FALSE,
verbose = TRUE
)Data frame returned by inat_fetch().
Character. Directory to save images and metadata. Created if
it does not exist. There is no default: you must specify a path, e.g.
a folder in your working directory or tempdir() for a temporary
location.
Character. Photo size: "square" (75px), "small" (240px),
"medium" (500px), "large" (1024px), or "original". Default
"large". The size is appended to the filename (e.g.
obs123_456_large.jpg).
Logical. If TRUE (default), automatically saves a
metadata.csv file to out_dir alongside the downloaded photos.
Logical. Re-download files that already exist (default
FALSE).
Logical. Print progress messages (default TRUE).
Invisibly returns a data frame of photo URLs and local file paths.
if (FALSE) { # \dontrun{
obs <- inat_fetch(taxon_id = 488444, place_id = 6783,
user_login = "someuser")
# Download photos and save metadata.csv to the same folder
inat_download(obs, out_dir = file.path(tempdir(), "my_photos"))
# Download photos only, no metadata
inat_download(obs, out_dir = file.path(tempdir(), "my_photos"),
metadata = FALSE)
} # }