downloadFiles {NHANES.RAW80Hz}R Documentation

Download files

Description

Download (non-raw) data files and save them as a different file type.

Usage

 downloadFiles(destDir, data, files=NULL, save.type="csv")

Arguments

destDir

Destination folder to download the files.

data

One of "2011-12", "2013-14", or "NNYFS".

files

Character vector of files to download. They must be strings from the Name or File columns in the returned data frame from getDataFileInfo. The default is NULL so that all files except the raw accelerometer data will be downloaded.

save.type

One of "xpt", "csv", or "rda", where "xpt" denotes a SAS transport file, "csv" denotes a comma separated file, and "rda" denotes an R object file that is saved using the save function and must be loaded using the load function. The default is "csv".

Details

The file names of the saved data will be prefixed with data and contain the value of the File column in the data frame from getDataFileInfo.

This function will not download the (large) raw accelerometer data. For that, the function downloadAcclRawData80Hz must be used.

Value

NULL

See Also

getDataFileInfo, downloadAcclRawData80Hz, downloadAndReadFile

Examples


  data <- "NNYFS"

  # Look up all possible files to download
  x <- getDataFileInfo(data)
  x[, 1:2]  

  # Download files "Cardiovascular Fitness", and "Plank" (rows 3 and 11 of above data frame)
  files   <- c("Cardiovascular Fitness", "Y_PLX")
  destDir <- "./" 
  ## Not run: 
    downloadFiles(destDir, data, files=files)
  
## End(Not run)


[Package NHANES.RAW80Hz version 0.0.3 Index]