atri_docs_download: Directly download a Docs file from standard topic

Description Usage Arguments Value See Also Examples

View source: R/atri_docs_download.R

Description

Download a Docs file from a standard topic-code by file label

Usage

1
2
3
4
5
6
7
8
9
atri_docs_download(
  protocol,
  topic,
  file_label,
  file = NA,
  out_dir = NULL,
  site_code = NULL,
  sort_first = NULL
)

Arguments

protocol:

The protocol name (e.g. 'a345').

topic:

The url topic code that the file is listed in.

file_label:

The label name of the file in the topic. Entered value is allowed to be a fixed and case-sensitive substring of the full file label.

file:

(optional; if no value entered, filename will be automatically generated by full file label and file extension based on file_type metadata.) File path of the downloaded file.

out_dir:

(optional; valid only when optional 'file' parameter is not entered) Output location for downloaded file. If no value entered, then current working directory is used.

site_code:

(optional) Required for site-restricted topics. The site code of the site that the user can access.

sort_first:

(optional) File downloaded will be the first record in the list of files based on the sorting of the allowable character parameter entered. Allowable parameters include: label, code, ts_last_modify, ts_create, ts_file_last_modify, file_size, file_type (descending order can be prefixed with '-'; e.g. '-label').

Value

atri_api object containing: response- response from http url; url- a string of complete url; protocol- a string of input protocol; filename- name of downloaded file.

See Also

atri_api

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Download file
atri_docs_download(protocol='a345', topic='transfer-invicro', file_label='A3-45 Participant List')
# Source downloaded file
resp<-atri_docs_download(protocol='a345', topic='transfer-invicro', file_label='A3-45 Participant List')
pt.list<-read.csv(resp$filename)

# Download file from site-restricted topic
atri_docs_download(protocol='a345', topic='site-reports-screening-enrollment-log', file_label='Enrollment_Log', site_code='002')

# Download file based on first record in sorted list of files
atri_docs_download(protocol='a345', topic='transfer-oracle', file_label='actc_prod_', sort_first='-ts_create') #Newest
atri_docs_download(protocol='a345', topic='transfer-oracle', file_label='actc_prod_', sort_first='ts_create') #Oldest

rg08705/test documentation built on Feb. 14, 2022, 3:07 a.m.