Commit 8d4c1abb authored by Jason Rigby's avatar Jason Rigby
Browse files

Merge branch 'update-s-drive-paths' into 'master'

refactor s-drive paths; update version number to 3

See merge request aspree/aspree-r-package!35
parents 326acd29 594ac173
#' Gets the S-drive path prefix based on the operating system used
#'
#' @param default the default prefix if the operating system-specific path can't be determined
#' @return the S-drive prefix
SDrivePrefix <- function(default = NULL) {
prefix <- switch(Sys.info()[['sysname']],
Windows="S:/MNHS-SPHPM-EPM",
Darwin="/Volumes/shared/MNHS-SPHPM-EPM"
)
ifelse(is.null(prefix), default, prefix)
}
#' Get S-drive paths
#'
#' Creates a set of file paths pointing to the official ASPREE datasets
......@@ -5,12 +17,9 @@
#' @param prefix the base path of the dataset location
#' @return a list mapping section name to file path
#' @export
SDrivePaths <- function(ver = 2, prefix = NA) {
SDrivePaths <- function(ver = 3, prefix = NA) {
if (is.na(prefix)) {
prefix <- switch(Sys.info()[['sysname']],
Windows="S:/MNHS-SPHPM-EPM",
Darwin="/Volumes/shared/MNHS-SPHPM-EPM"
)
prefix <- SDrivePrefix()
if (is.null(prefix)) {
stop("Please specify the prefix for S Drive data, e.g. \"S:/MNHS-SPHPM-EPM/ASPREE-Data/ASPREE Longitudinal Data Set/\"")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment