Skip to content

Commit

Permalink
Updated version, NEWS, minor documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Krieger committed Mar 18, 2020
1 parent 6776f5d commit 41837d3
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 56 deletions.
2 changes: 1 addition & 1 deletion 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",
Expand Down
13 changes: 13 additions & 0 deletions 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:
Expand Down
16 changes: 7 additions & 9 deletions 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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -85,23 +83,23 @@
#' #############################################################################
#' # 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()) {
vec_assert(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"
Expand Down
16 changes: 7 additions & 9 deletions 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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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()) {
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Expand Up @@ -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*
Expand Down
51 changes: 25 additions & 26 deletions README.md
Expand Up @@ -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*
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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
#> <int> <chr> <prjstg> <chr> <chr> <dttm>
Expand Down Expand Up @@ -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
#> <int> <chr> <prjstg> <chr> <chr> <dttm>
Expand Down Expand Up @@ -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
#> <int> <chr> <prjstg> <chr> <chr> <dttm>
Expand Down Expand Up @@ -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
#> <int> <chr> <prjstg> <chr> <chr> <dttm>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -802,9 +801,9 @@ projects(verbose = TRUE) %>% select(id, short_title, path)
#> # A tibble: 3 x 3
#> id short_title path
#> <int> <chr> <chr>
#> 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
Expand All @@ -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
Expand All @@ -834,7 +833,7 @@ move_project("Crown", path = "Greek_studies/ancient_studies")
#> # creator <prjaut>
#>
#> 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",
Expand All @@ -849,7 +848,7 @@ copy_project(
#> # creator <prjaut>
#>
#> 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
#> <int> <chr> <lgl> <prjaut> <chr> <chr> <dttm>
Expand All @@ -858,9 +857,9 @@ copy_project(
#> # creator <prjaut>
#>
#> 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).
Expand All @@ -871,9 +870,9 @@ projects(c("Crown", "Radon"), verbose = TRUE) %>% select(id, title, path)
#> # A tibble: 3 x 3
#> id title path
#> <int> <chr> <chr>
#> 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
Expand All @@ -891,7 +890,7 @@ archive_project("Strangelove")
#> # creator <prjaut>
#>
#> 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()`
Expand All @@ -902,18 +901,18 @@ projects(verbose = TRUE) %>% select(id, short_title, path)
#> # A tibble: 3 x 3
#> id short_title path
#> <int> <chr> <chr>
#> 1 2 Eureka! /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/p0002
#> 2 4 <NA> /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 <NA> /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
#> <int> <chr> <chr>
#> 1 1945 Dr. Strangelo… /tmp/Rtmpr4fD5C/projects/top_secret/archive/p1945
#> 2 2 Eureka! /tmp/Rtmpr4fD5C/projects/Greek_studies/ancient_studies/p…
#> 3 4 <NA> /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 <NA> /tmp/RtmpBBoEOw/projects/dangerous_studies/radioactive_s…
#> 4 3 Rn86 /tmp/RtmpBBoEOw/projects/p0003
```

Lastly, affiliations, authors and projects can be deleted with the
Expand Down
3 changes: 3 additions & 0 deletions 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.

Expand Down
8 changes: 3 additions & 5 deletions man/projects_author.Rd

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

8 changes: 3 additions & 5 deletions man/projects_stage.Rd

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

0 comments on commit 41837d3

Please sign in to comment.