diff --git a/DESCRIPTION b/DESCRIPTION index 30f6043..b462c04 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Rcbpp Title: R Utilities for CBPP Research -Version: 0.10.2 +Version: 0.10.3 Authors@R: c( person( given = "Claire", diff --git a/NEWS.md b/NEWS.md index 1de514b..04d4ffb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# Rcbpp 0.10.3 + +- Hot fix for `sp_*` functions ([#28](https://github.com/CenterOnBudget/Rcbpp/issues/28)) + + # Rcbpp 0.10.2 - The `cpi_u_rs` dataset is updated with the latest available figures, for calendar year 2023. diff --git a/R/sp_data.R b/R/sp_data.R index e5017ce..a0af8dd 100644 --- a/R/sp_data.R +++ b/R/sp_data.R @@ -1,15 +1,14 @@ -#' Create paths to files in the SharePoint datasets library +#' Create paths to files in a synced datasets library #' -#' Functions for creating paths to files in the SharePoint datasets library. +#' Functions for creating paths to files in a synced datasets library. #' These functions are designed to be simple and compact. #' -#' These functions create one or more file paths based on the user's path to -#' the SharePoint datasets library (as created by -#' [sp_data_path()] and the directory -#' structure and file naming convention of each dataset library. These functions -#' do not verify whether the resulting files actually exist. +#' These functions create one or more file paths based on [sp_data_path()] +#' and the directory structure and file naming convention of each dataset +#' library. These functions do not verify whether the resulting files actually +#' exist. #' #' @section Requesting a function: #' If you'd like to request an `sp_*()` function for a dataset you use @@ -21,7 +20,7 @@ #' @param f Format of data. One of `"csv"`, `"dta"`, or `"parquet"`. #' @return A character vector containing the created file paths. #' @seealso [sp_data_path()] to get your -#' basic path to the SharePoint datasets library. +#' basic path to a synced datasets library. #' #' @name sp_data NULL diff --git a/R/sp_path.R b/R/sp_path.R index 41cb3f9..de7ab54 100644 --- a/R/sp_path.R +++ b/R/sp_path.R @@ -3,10 +3,9 @@ #' Create a path to SharePoint and OneDrive directories #' #' @description -#' `sp_path()` creates a path to the user's SharePoint directory. +#' `sp_path()` creates a path to the directory for synced SharePoint folders. #' -#' `sp_data_path()` creates a path to the SharePoint datasets library -#' for the user. +#' `sp_data_path()` creates the start of the path to a synced datasets library. #' #' `od_path()` creates a path to the user's OneDrive. #' @@ -17,7 +16,7 @@ #' @return A character vector of length one (invisibly). #' @aliases make_sp_data_path #' @seealso [`sp_data`] for functions for creating paths to files in -#' the SharePoint datasets library. +#' a synced datasets library. #' #' @name sp_path NULL @@ -51,11 +50,5 @@ sp_path <- function(path = NULL) { user_home <- function() { - sys_info <- Sys.info() - if (sys_info["sysname"] == "Windows") { - root <- "C:/" - } else { - root <- "/" - } - paste0(root, "Users/", sys_info["user"]) + Sys.getenv("USERPROFILE") } diff --git a/Rcbpp.Rproj b/Rcbpp.Rproj index 497f8bf..1481d00 100644 --- a/Rcbpp.Rproj +++ b/Rcbpp.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 8a47b9a4-09bd-4ded-a806-8140cdb6d29d RestoreWorkspace: Default SaveWorkspace: Default diff --git a/man/sp_data.Rd b/man/sp_data.Rd index 6009976..a46dca0 100644 --- a/man/sp_data.Rd +++ b/man/sp_data.Rd @@ -5,7 +5,7 @@ \alias{sp_acs} \alias{sp_cps_asec} \alias{sp_cps_basic} -\title{Create paths to files in the SharePoint datasets library} +\title{Create paths to files in a synced datasets library} \usage{ sp_acs(y, f) @@ -24,15 +24,14 @@ sp_cps_basic(y, m, f) A character vector containing the created file paths. } \description{ -Functions for creating paths to files in the SharePoint datasets library. +Functions for creating paths to files in a synced datasets library. These functions are designed to be simple and compact. } \details{ -These functions create one or more file paths based on the user's path to -the SharePoint datasets library (as created by -\code{\link[=sp_data_path]{sp_data_path()}} and the directory -structure and file naming convention of each dataset library. These functions -do not verify whether the resulting files actually exist. +These functions create one or more file paths based on \code{\link[=sp_data_path]{sp_data_path()}} +and the directory structure and file naming convention of each dataset +library. These functions do not verify whether the resulting files actually +exist. } \section{Requesting a function}{ @@ -43,5 +42,5 @@ frequently, please file an \seealso{ \code{\link[=sp_data_path]{sp_data_path()}} to get your -basic path to the SharePoint datasets library. +basic path to a synced datasets library. } diff --git a/man/sp_path.Rd b/man/sp_path.Rd index fdc4532..90818ae 100644 --- a/man/sp_path.Rd +++ b/man/sp_path.Rd @@ -20,10 +20,9 @@ sp_path(path = NULL) A character vector of length one (invisibly). } \description{ -\code{sp_path()} creates a path to the user's SharePoint directory. +\code{sp_path()} creates a path to the directory for synced SharePoint folders. -\code{sp_data_path()} creates a path to the SharePoint datasets library -for the user. +\code{sp_data_path()} creates the start of the path to a synced datasets library. \code{od_path()} creates a path to the user's OneDrive. @@ -32,5 +31,5 @@ exist. } \seealso{ \code{\link{sp_data}} for functions for creating paths to files in -the SharePoint datasets library. +a synced datasets library. }