download_session_assets_fr_df {databraryr}R Documentation

Download Asset From A Databrary Session.

Description

Databrary stores file types (assets) of many types. This function downloads assets in a data frame generated by list_session_assets().

Usage

download_session_assets_fr_df(
  session_df = list_session_assets(),
  target_dir = tempdir(),
  add_session_subdir = TRUE,
  overwrite = TRUE,
  make_portable_fn = FALSE,
  timeout_secs = REQUEST_TIMEOUT_VERY_LONG,
  vb = options::opt("vb"),
  rq = NULL
)

Arguments

session_df

A data frame as generated by list_session_assets_2().

target_dir

A character string. Directory to save the downloaded file. Default is directory named after the session_id.

add_session_subdir

A logical value. Add add the session name to the file path so that files are in a subdirectory specific to the session. Default is TRUE.

overwrite

A logical value. Overwrite an existing file. Default is TRUE.

make_portable_fn

A logical value. Replace characters in file names that are not broadly portable across file systems. Default is FALSE.

timeout_secs

An integer. The seconds an httr2 request will run before timing out. Default is 600 (10 min). This is to handle very large files.

vb

Show verbose messages. (Defaults to FALSE, overwritable using option 'databraryr.vb' or environment variable 'R_DATABRARYR_VB')

rq

A list in the form of an httr2 request object. Default is NULL.

Value

Full file names to the downloaded assets or NULL.

Examples


## Not run: 
download_session_assets_fr_df() # Downloads all of the files from session
9807 in Databrary volume 1.

# Just the CSVs
v1 <- list_session_assets()
v1_csv <- dplyr::filter(v1, format_extension == "csv")
download_session_assets_fr_df(v1_csv, vb = TRUE)

## End(Not run)


[Package databraryr version 0.6.6 Index]