Use Case 3 - Downloading entire data packages using DOIs

Julien Brun, Mitchell Maier and Irene Steves, NCEAS



This vignette aims to showcase a use case when the user wants to download all the datasets of a data package using metajam - download_d1_data_pkg.

In this example we use a csv file storing packages returned after searching for soil bulk density on Arctic Data Center and KNB data repositories.

Libraries and constants

# devtools::install_github("NCEAS/metajam")
# Directory to save the data set
path_folder <- "./Soil_bulk"

# URL to read the search results stored as a csv on Google Drive
csv_search_results_url <- ""

Download all the datasets from data packages using DOIs

# Create the local directory to store data sets
dir.create(path_folder, showWarnings = FALSE)

# Read the data listing from Google Drive:
data_listing <- read_csv(csv_search_results_url)

### Download the data and metadata ----

# Create the list of unique dois
dois <- unique(data_listing$identifier)

# batch download the datasets
data_folders <- map(dois, ~download_d1_data_pkg(.x, path_folder))