Learn R Programming

galah (version 1.5.4)

collect_media: Collect media files

Description

This function downloads full-sized or thumbnail images and media files using information from atlas_media to a local directory.

Usage

collect_media(
  df,
  type = c("full", "thumbnail"),
  path,
  download_dir,
  refresh_cache
)

Value

Available image & media files downloaded to a user local directory.

Arguments

df

tibble returned by atlas_media() or show_all(media)

type

string: either "full" to download original images, or "thumbnail" to download thumbnails

path

string: path to directory where downloaded media will be stored

download_dir

[Deprecated] Use path instead.

refresh_cache

logical: if set to TRUE and galah_config(caching = TRUE) then files cached from a previous query will be replaced by the current query. NOTE: Unclear that this works right now.

Examples

Run this code
if (FALSE) {
# Use `atlas_media()` to return a `tibble` of records that contain media
galah_call() |> 
  galah_identify("perameles") |>
  galah_filter(year == 2015) |>
  atlas_media()

# To download media files, add `collect_media()` to the end of a query 
galah_call() |> 
  galah_identify("perameles") |>
  galah_filter(year == 2015) |>
  atlas_media() |>
  collect_media(path = here::here("folder", "subfolder"))
}

Run the code above in your browser using DataLab