Skip to contents

Retrieves additional data from internet. The data format must be .RDS or a zipped .RDS. The purpose of this function is to download data such as longitudinal response parameters from an online repository or cross-sectional population data.

Data for this package is available at: https://osf.io/ne8pc/files/osfstorage

You can save the data into your chosen directory using the optional savePath argument. Specify the file path and the file name.

Large datasets may timeout. If so, you can increase the download time by updating the maximum timeout time in the code below. (Ex: increase from 300 to 1000) options(timeout = max(300, getOption("timeout")))

Usage

get_additional_data(fileURL, savePath = NULL)

Arguments

fileURL

URL of the file to be downloaded.

savePath

Folder directory and filename to save the downloaded and unzipped (if needed) file. File is saved only if this argument is not NULL. Optional. Default = NULL.

Value

the R object stored in the file indicated by the fileURL input Data object

Examples

if (FALSE) { # \dontrun{
curve_param_samples <-
  get_additional_data(
    fileURL = "https://osf.io/download/bhfvx"
  )

# optionally, save the data to disk
curve_param_samples <-
  get_additional_data(
    fileURL = "https://osf.io/download/bhfvx",
    savePath = "~/Downloads/curv_params.rds"
  )
} # }