Description Usage Arguments Value See Also Examples
View source: R/atri_docs_download.R
Download a Docs file from a standard topic-code by file label
1 2 3 4 5 6 7 8 9 |
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'). |
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.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.