diff --git a/DESCRIPTION b/DESCRIPTION index e52d73e..f81a0be 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: projects Title: A Project Infrastructure for Researchers -Version: 2.0.99.9005 +Version: 2.1.0 Authors@R: c(person(given = "Nik", family = "Krieger", diff --git a/NEWS.md b/NEWS.md index 35afe70..c8fd9eb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,17 @@ +# projects 2.1.0 + +## Major updates: +- Addition of `rename_projects_folder()` and `move_projects_folder()` +- Addition of `path` argument to `projects()`, allowing users to filter by subdirectory +- Incorporation of `vctrs` package for `projects_stage` and `projects_author` classes + +## Minor updates: +- `projects()` now prints a maximum of 100 rows by default. +- `open_project()` attempts to locate projects on shared servers when the local `projects_folder()` value differs from the server's `projects_folder()` value +- Backslash inserted before any single quotation marks in projects folder path before being written to .Renviron +- Bug, documentation, README improvements + # projects 2.0.0 ## Major updates: diff --git a/R/class-projects_author.R b/R/class-projects_author.R index 75cee6b..bd98226 100755 --- a/R/class-projects_author.R +++ b/R/class-projects_author.R @@ -1,5 +1,5 @@ -#' \code{projects_author} class and its methods +#' \code{projects_author} vector #' #' Objects of this class contain both the \code{id} and the \code{last_name} of #' an author so that the package and the user, respectively, can easily identify @@ -37,8 +37,6 @@ #' string, or a \code{projects_author} object. See \code{\link{match}()} and #' \strong{Equality and value matching methods} below. #' -#' @param ... further arguments passed to or from other methods. -#' #' @param table An integer number, a character string, or a #' \code{projects_author} object. See \code{\link{match}()} and #' \strong{Equality and value matching methods} below. @@ -85,10 +83,12 @@ #' ############################################################################# #' # Cleanup (or just restart R) #' Sys.setenv(HOME = old_home, PROJECTS_FOLDER_PATH = old_ppath) -#' @rdname projects_author #' @import vctrs #' @export -methods::setClass("projects_author") +projects_author <- function(x = character()) { + x <- vec_cast(x, character()) + validate_projects_author(x) +} new_projects_author <- function(x = character()) { @@ -96,12 +96,10 @@ new_projects_author <- function(x = character()) { new_vctr(x, class = "projects_author") } + #' @rdname projects_author #' @export -projects_author <- function(x = character()) { - x <- vec_cast(x, character()) - validate_projects_author(x) -} +methods::setClass("projects_author") #' @export vec_ptype_abbr.projects_author <- function(x, ...) "prjaut" diff --git a/R/class-projects_stage.R b/R/class-projects_stage.R index b063375..5cca4d2 100755 --- a/R/class-projects_stage.R +++ b/R/class-projects_stage.R @@ -1,5 +1,5 @@ -#' \code{projects_stage} class and its methods +#' \code{projects_stage} vector #' #' Objects of this class are merely a character string containing a number and a #' name of one of seven project development stages. @@ -37,8 +37,6 @@ #' string, or a \code{projects_stage} object. See \code{\link{match}()} and #' \strong{Comparison and value matching methods} below. #' -#' @param ... further arguments passed to or from other methods. -#' #' @param table An integer number, a character string, or a #' \code{projects_stage} object. See \code{\link{match}()} and #' \strong{Comparison and value matching methods} below. @@ -70,9 +68,11 @@ #' more_stages <- projects_stage(c("0: idea", "4: manuscript", "1: design")) #' #' match("MAnuscRIPT", more_stages) # 2 -#' @rdname projects_stage #' @export -methods::setClass("projects_stage") +projects_stage <- function(x = character()) { + x <- vec_cast(x, character()) + validate_stage(x) +} new_projects_stage <- function(x = character()) { @@ -83,10 +83,8 @@ new_projects_stage <- function(x = character()) { #' @rdname projects_stage #' @export -projects_stage <- function(x = character()) { - x <- vec_cast(x, character()) - validate_stage(x) -} +methods::setClass("projects_stage") + #' @export vec_ptype_abbr.projects_stage <- function(x, ...) "prjstg" diff --git a/README.Rmd b/README.Rmd index 392bb7b..5490efe 100755 --- a/README.Rmd +++ b/README.Rmd @@ -132,7 +132,7 @@ In keeping with relational database theory, there are two *.rds* files that keep Users create individual project folders with the function `new_project()`. By default, the name of each project folder is of the form p*XXXX*, where *XXXX* is the project's `id` padded with 0s on the left side. Its contents are copied from a template project folder within the *.templates* directory in the main */projects* folder. -The default project folder template is strutured as follows: +The default project folder template is structured as follows: - */p*XXXX + */data* diff --git a/README.md b/README.md index e4387cd..5d666bd 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ form p*XXXX*, where *XXXX* is the project’s `id` padded with 0s on the left side. Its contents are copied from a template project folder within the *.templates* directory in the main */projects* folder. -The default project folder template is strutured as follows: +The default project folder template is structured as follows: - */p*XXXX - */data* @@ -378,7 +378,7 @@ library(projects) ``` r setup_projects("~") #> projects folder created at -#> /tmp/Rtmpr4fD5C/projects +#> /tmp/RtmpBBoEOw/projects #> #> Add affiliations with new_affiliation(), #> then add authors with new_author(), @@ -579,7 +579,7 @@ new_project( ) #> #> Project 1 has been created at -#> /tmp/Rtmpr4fD5C/projects/p0001 +#> /tmp/RtmpBBoEOw/projects/p0001 #> # A tibble: 1 x 6 #> id title stage status deadline_type deadline #> @@ -620,7 +620,7 @@ new_project( ) #> #> Project 2 has been created at -#> /tmp/Rtmpr4fD5C/projects/p0002 +#> /tmp/RtmpBBoEOw/projects/p0002 #> # A tibble: 1 x 6 #> id title stage status deadline_type deadline #> @@ -653,7 +653,7 @@ new_project( ) #> #> Project 1945 has been created at -#> /tmp/Rtmpr4fD5C/projects/top_secret/p1945 +#> /tmp/RtmpBBoEOw/projects/top_secret/p1945 #> # A tibble: 1 x 6 #> id title stage status deadline_type deadline #> @@ -682,7 +682,7 @@ new_project( ) #> #> Project 3 has been created at -#> /tmp/Rtmpr4fD5C/projects/p0003 +#> /tmp/RtmpBBoEOw/projects/p0003 #> # A tibble: 1 x 6 #> id title stage status deadline_type deadline #> @@ -766,7 +766,6 @@ edit_affiliation( affiliation = "Impossibles", department_name = "Pseudoscience Debunking Unit" ) -#> Edited affiliation: ``` The text to be pasted in the YAML can be obtained for any given project @@ -802,9 +801,9 @@ projects(verbose = TRUE) %>% select(id, short_title, path) #> # A tibble: 3 x 3 #> id short_title path #> -#> 1 1945 Dr. Strangelove /tmp/Rtmpr4fD5C/projects/top_secret/p1945 -#> 2 2 Eureka! /tmp/Rtmpr4fD5C/projects/p0002 -#> 3 3 Rn86 /tmp/Rtmpr4fD5C/projects/p0003 +#> 1 1945 Dr. Strangelove /tmp/RtmpBBoEOw/projects/top_secret/p1945 +#> 2 2 Eureka! /tmp/RtmpBBoEOw/projects/p0002 +#> 3 3 Rn86 /tmp/RtmpBBoEOw/projects/p0003 ``` Users can also create subdirectories with the function @@ -814,7 +813,7 @@ Users can also create subdirectories with the function new_project_group("Greek_studies/ancient_studies") #> #> The following directory was created: -#> /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies +#> /tmp/RtmpBBoEOw/projects/Greek_studies/ancient_studies ``` If a project has already been created, it can be moved **not** with @@ -834,7 +833,7 @@ move_project("Crown", path = "Greek_studies/ancient_studies") #> # creator #> #> Project 2 moved so that its new path is -#> /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/p0002 +#> /tmp/RtmpBBoEOw/projects/Greek_studies/ancient_studies/p0002 copy_project( project_to_copy = "Radon", @@ -849,7 +848,7 @@ copy_project( #> # creator #> #> Project 4 below is a copy of project 3 and is located at -#> /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_studies/radon_studies/p0004 +#> /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_studies/radon_studies/p0004 #> # A tibble: 1 x 11 #> id title short_title current_owner status deadline_type deadline #> @@ -858,9 +857,9 @@ copy_project( #> # creator #> #> The .Rproj file -#> /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_studies/radon_studies/p0004/p0003.Rproj +#> /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_studies/radon_studies/p0004/p0003.Rproj #> was renamed to -#> /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_studies/radon_studies/p0004/p0004.Rproj +#> /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_studies/radon_studies/p0004/p0004.Rproj #> #> Be sure to change all instances of "p0003" to "p0004" as desired #> (e.g., .bib files and references to them in YAML headers). @@ -871,9 +870,9 @@ projects(c("Crown", "Radon"), verbose = TRUE) %>% select(id, title, path) #> # A tibble: 3 x 3 #> id title path #> -#> 1 2 Weighing the C… /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/… -#> 2 4 Understanding … /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_… -#> 3 3 Understanding … /tmp/Rtmpr4fD5C/projects/p0003 +#> 1 2 Weighing the C… /tmp/RtmpBBoEOw/projects/Greek_studies/ancient_studies/… +#> 2 4 Understanding … /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_… +#> 3 3 Understanding … /tmp/RtmpBBoEOw/projects/p0003 ``` Projects can also be archived; they are moved into a subdirectory called @@ -891,7 +890,7 @@ archive_project("Strangelove") #> # creator #> #> The above project was archived and has the file path -#> /tmp/Rtmpr4fD5C/projects/top_secret/archive/p1945 +#> /tmp/RtmpBBoEOw/projects/top_secret/archive/p1945 ``` When a project is archived, it is no longer included in `projects()` @@ -902,18 +901,18 @@ projects(verbose = TRUE) %>% select(id, short_title, path) #> # A tibble: 3 x 3 #> id short_title path #> -#> 1 2 Eureka! /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/p0002 -#> 2 4 /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_stud… -#> 3 3 Rn86 /tmp/Rtmpr4fD5C/projects/p0003 +#> 1 2 Eureka! /tmp/RtmpBBoEOw/projects/Greek_studies/ancient_studies/p0002 +#> 2 4 /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_stud… +#> 3 3 Rn86 /tmp/RtmpBBoEOw/projects/p0003 projects(verbose = TRUE, archived = TRUE) %>% select(id, short_title, path) #> # A tibble: 4 x 3 #> id short_title path #> -#> 1 1945 Dr. Strangelo… /tmp/Rtmpr4fD5C/projects/top_secret/archive/p1945 -#> 2 2 Eureka! /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/p… -#> 3 4 /tmp/Rtmpr4fD5C/projects/dangerous_studies/radioactive_s… -#> 4 3 Rn86 /tmp/Rtmpr4fD5C/projects/p0003 +#> 1 1945 Dr. Strangelo… /tmp/RtmpBBoEOw/projects/top_secret/archive/p1945 +#> 2 2 Eureka! /tmp/RtmpBBoEOw/projects/Greek_studies/ancient_studies/p… +#> 3 4 /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_s… +#> 4 3 Rn86 /tmp/RtmpBBoEOw/projects/p0003 ``` Lastly, affiliations, authors and projects can be deleted with the diff --git a/cran-comments.md b/cran-comments.md index da83465..feff123 100755 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,7 @@ +## Update to version 2.1.0 +There were no ERRORs, WARNINGs, or NOTEs. + ## Update to version 2.0.0 There were no ERRORS, WARNING, or NOTES. diff --git a/man/projects_author.Rd b/man/projects_author.Rd index df250f3..de19d53 100644 --- a/man/projects_author.Rd +++ b/man/projects_author.Rd @@ -1,16 +1,16 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/class-projects_author.R \docType{class} -\name{projects_author-class} -\alias{projects_author-class} +\name{projects_author} \alias{projects_author} +\alias{projects_author-class} \alias{match.projects_author} \alias{match,projects_author,ANY-method} \alias{match,ANY,projects_author-method} \alias{match,projects_author,projects_author-method} \alias{\%in\%.projects_author} \alias{\%in\%,projects_author-method} -\title{\code{projects_author} class and its methods} +\title{\code{projects_author} vector} \usage{ projects_author(x = character()) @@ -41,8 +41,6 @@ match.projects_author(x, table, nomatch = NA_integer_, incomparables = NULL) \item{incomparables}{An integer number, a character string, or a \code{projects_author} object. See \code{\link{match}()}.} - -\item{...}{further arguments passed to or from other methods.} } \description{ Objects of this class contain both the \code{id} and the \code{last_name} of diff --git a/man/projects_stage.Rd b/man/projects_stage.Rd index 66451bd..d893734 100644 --- a/man/projects_stage.Rd +++ b/man/projects_stage.Rd @@ -1,16 +1,16 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/class-projects_stage.R \docType{class} -\name{projects_stage-class} -\alias{projects_stage-class} +\name{projects_stage} \alias{projects_stage} +\alias{projects_stage-class} \alias{match.projects_stage} \alias{match,projects_stage,ANY-method} \alias{match,ANY,projects_stage-method} \alias{match,projects_stage,projects_stage-method} \alias{\%in\%.projects_stage} \alias{\%in\%,projects_stage-method} -\title{\code{projects_stage} class and its methods} +\title{\code{projects_stage} vector} \usage{ projects_stage(x = character()) @@ -41,8 +41,6 @@ match.projects_stage(x, table, nomatch = NA_integer_, incomparables = NULL) \item{incomparables}{An integer number, a character string, or a \code{projects_stage} object. See \code{\link{match}()}.} - -\item{...}{further arguments passed to or from other methods.} } \value{ For \code{projects_stage()}, an S3 vector of class