Description Usage Arguments Value Examples
View source: R/nsrr_download.R
NSRR Download file
1 2 3 4 | nsrr_download_url(dataset, path, token = nsrr_token())
nsrr_download_file(dataset, path, token = nsrr_token(),
check_md5 = TRUE)
|
dataset |
a dataset |
path |
full path to the file. |
token |
Token for NSRR resources. Found at https://sleepdata.org/token |
check_md5 |
check if MD5 checksum agrees when downloaded |
A data.frame
of the data sets and their endpoints
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dataset = "shhs"
path = "datasets/shhs-data-dictionary-0.13.2-domains.csv"
nsrr_download_url(dataset, path, token = "")
if (nsrr_have_token()) {
res = nsrr_download_file(dataset, path)
testthat::expect_true(res$success)
path = "biostatistics-with-r/shhs1.txt"
res = nsrr_download_file(dataset, path)
}
url = nsrr_download_url("shhs", path = "datasets/CHANGELOG.md",
token = NULL)
res = nsrr_download_file("shhs", path = "datasets/CHANGELOG.md",
token = NULL)
testthat::expect_true(res$correct_md5)
res = nsrr_download_file("shhs", path = "datasets/CHANGELOG.md",
token = NULL, check_md5 = FALSE)
testthat::expect_null(res$correct_md5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.