Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
15 changes: 7 additions & 8 deletions R/sp_data.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
15 changes: 4 additions & 11 deletions R/sp_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand All @@ -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
Expand Down Expand Up @@ -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")
}
1 change: 1 addition & 0 deletions Rcbpp.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 8a47b9a4-09bd-4ded-a806-8140cdb6d29d

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
15 changes: 7 additions & 8 deletions man/sp_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/sp_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading