Skip to content

Commit

Permalink
Merge branch 'release-0.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHeun committed May 23, 2023
2 parents 871cffb + f41f3a9 commit c8f8ba9
Show file tree
Hide file tree
Showing 40 changed files with 223 additions and 116 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.4.3
Date: 2023-05-23 19:41:51 UTC
SHA: 34d8dc8370dc882ca653f25e3833056f5d6907a3
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: matsindf
Type: Package
Title: Matrices in Data Frames
Version: 0.4.2
Date: 2023-05-04
Version: 0.4.3
Date: 2023-05-23
Authors@R: c(person("Matthew", "Heun", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7438-214X"),
email = "[email protected]"))
Expand All @@ -19,6 +19,7 @@ Depends: R (>= 2.10)
Imports:
assertthat,
dplyr,
lifecycle,
magrittr,
matsbyname,
purrr,
Expand Down
13 changes: 12 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ title: "Release notes for `matsindf`"
output: html_document
---

# matsindf 0.4.2 (2023-05-04)

# matsindf 0.4.3 (2023-05-23)

* Deprecated `matrix.class` argument.
It will be removed soon.
* Renamed `matrix.class` argument to `matrix_class`.
* New tests for deprecations.
* Now at 376 tests, all passing.
* Test coverage remains at 100 %.


# matsindf 0.4.2 (2023-05-04) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7896799.svg)](https://doi.org/10.5281/zenodo.7896799)

* Move to latest version of GitHub test coverage workflow.
* This version not released to CRAN.
Expand Down
23 changes: 18 additions & 5 deletions R/collapse.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@
#' @param coltypes An optional string identifying the column in `.DF` containing the type of values in columns of the matrices to be created
#' Default is `if ("coltypes" %in% names(.DF)) "rowtypes" else NULL`,
#' so that failure to set the coltypes argument will give `NULL`, as appropriate.
#' @param matrix.class The type of matrix to be created, one of "matrix" or "Matrix".
#' Default is "matrix".
#' @param matrix.class `r lifecycle::badge("deprecated")` Use `matrix_class` instead.
#' @param matrix_class One of "matrix" or "Matrix".
#' "matrix" creates a `base::matrix` object with the `matrix()` function.
#' "Matrix" creates a `Matrix::Matrix` object using the `matsbyname::Matrix()` function.
#' This could be a sparse matrix.
#' Default is "matrix".
#'
#' @return A data frame with matrices in the `matvals` column.
#'
Expand Down Expand Up @@ -96,8 +100,17 @@
collapse_to_matrices <- function(.DF, matnames = "matnames", matvals = "matvals", rownames = "rownames", colnames = "colnames",
rowtypes = if ("rowtypes" %in% names(.DF)) "rowtypes" else NULL,
coltypes = if ("coltypes" %in% names(.DF)) "coltypes" else NULL,
matrix.class = c("matrix", "Matrix")) {
matrix.class <- match.arg(matrix.class)
matrix.class = lifecycle::deprecated(),
matrix_class = c("matrix", "Matrix")) {
if (lifecycle::is_present(matrix.class)) {
lifecycle::deprecate_warn(when = "0.4.3",
what = "create_matrix_byname(matrix.class)",
with = "create_matrix_byname(matrix_class)")
matrix_class <- matrix.class
}

matrix_class <- match.arg(matrix_class)

# Ensure that none of rownames, colnames, or values is a group variable.
# These can't be in the group variables.
# If they were, we wouldn't be able to summarise them into the matrices.
Expand Down Expand Up @@ -130,7 +143,7 @@ collapse_to_matrices <- function(.DF, matnames = "matnames", matvals = "matvals"
# Convert .DF to matrices
"{matvals}" := rowcolval_to_mat(.data, rownames = rownames, colnames = colnames, matvals = matvals,
rowtypes = rowtypes, coltypes = coltypes,
matrix.class = matrix.class)
matrix_class = matrix_class)
) %>%
dplyr::select(!!!dplyr::group_vars(.DF), !!matvals) %>%
data.frame(check.names = FALSE)
Expand Down
22 changes: 18 additions & 4 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ mat_to_rowcolval <- function(.matrix, matvals = "matvals",
#' @param rowtypes An optional string identifying the types of information found in rows of the matrix to be constructed. Default is "rowtypes".
#' @param coltypes An optional string identifying the types of information found in columns of the matrix to be constructed. Default is "coltypes".
#' @param fill The value for missing entries in the resulting matrix. default is `0`.
#' @param matrix.class The type of matrix to be created, one of "matrix" or "Matrix".
#' @param matrix.class `r lifecycle::badge("deprecated")` Use `matrix_class` instead.
#' @param matrix_class One of "matrix" or "Matrix".
#' "matrix" creates a `base::matrix` object with the `matrix()` function.
#' "Matrix" creates a `Matrix::Matrix` object using the `matsbyname::Matrix()` function.
#' This could be a sparse matrix.
#' Default is "matrix".
#'
#' @return A matrix with named rows and columns and, optionally, row and column types.
Expand Down Expand Up @@ -142,8 +146,18 @@ mat_to_rowcolval <- function(.matrix, matvals = "matvals",
rowcolval_to_mat <- function(.DF, matvals = "matvals",
rownames = "rownames", colnames = "colnames",
rowtypes = "rowtypes", coltypes = "coltypes",
fill = 0, matrix.class = c("matrix", "Matrix")){
matrix.class <- match.arg(matrix.class)
fill = 0,
matrix.class = lifecycle::deprecated(),
matrix_class = c("matrix", "Matrix")) {
if (lifecycle::is_present(matrix.class)) {
lifecycle::deprecate_warn(when = "0.4.3",
what = "create_matrix_byname(matrix.class)",
with = "create_matrix_byname(matrix_class)")
matrix_class <- matrix.class
}

matrix_class <- match.arg(matrix_class)

if (!is.null(rowtypes)) {
# If rowtype is supplied and is not NA, check if it is one of the columns of .DF
if (rowtypes %in% colnames(.DF)) {
Expand Down Expand Up @@ -206,7 +220,7 @@ rowcolval_to_mat <- function(.DF, matvals = "matvals",
tibble::column_to_rownames(var = rownames) %>%
as.matrix() %>%
matsbyname::setrowtype(rowtype = rowtypes) %>% matsbyname::setcoltype(coltype = coltypes)
if (matrix.class == "Matrix") {
if (matrix_class == "Matrix") {
out <- matsbyname::Matrix(out)
}
return(out)
Expand Down
83 changes: 43 additions & 40 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,77 @@
## Context

`matsindf` v0.4.1 includes a rewrite of `matsindf_apply()`
to make it easier to debug and maintain.
`matsindf` v0.4.3 includes a rewrite of `matsindf_apply()`,
making it easier to debug and maintain.
Better error messages are now available, too.
Finally, the latest version of the GitHub test coverage workflow
is now being used.
See `NEWS.md` for details.


## Test environments (12 in total) and R CMD check results

* local: macOS X 13.3.1 (Ventura), R4.3.0
* local: macOS X 13.3.1(a) (Ventura), R4.3.0
* errors: 0
* warnings: 0
* notes: 0
* GitHub Actions:
* macOS-latest (release)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* ubuntu-latest (devel)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* ubuntu-latest (release)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* ubuntu-latest (oldrel-1)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* windows-latest (release)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* Windows (on win-builder):
* `devtools::check_win_release()`, R version 4.3.0 (2023-04-21 ucrt)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* `devtools::check_win_oldrelease()`, R version 4.2.3 (2023-03-15 ucrt)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* `devtools::check_win_devel()` R Under development (unstable) (2023-04-25 r84327 ucrt)
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 0
* errors: 0
* warnings: 0
* notes: 0
* `devtools::check_win_devel()` R Under development (unstable) (2023-05-19 r84451 ucrt)
* errors: 0
* warnings: 0
* notes: 0
* rhub:
* `devtools::check_rhub()`
* Windows Server 2022, R-devel, 64 bit
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 1
* errors: 0
* warnings: 0
* notes: 2
- checking for non-standard things in the check directory ... NOTE
- Found the following files/directories:
- ''NULL''
- checking for detritus in the temp directory ... NOTE
- Found the following files/directories:
- 'lastMiKTeXException'
- This note appears to be a minor problem with the cleanup process, not caused by the `matsindf` package itself.
* `devtools::check_rhub()`
- These notes appear to be minor problems with the cleanup process, not caused by the `matsindf` package itself.
* Ubuntu Linux 20.04.1 LTS, R-release, GCC
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 1
* errors: 0
* warnings: 0
* notes: 1
- checking HTML version of manual ... NOTE
- Skipping checking HTML validation: no command 'tidy' found
- This NOTE appears to be an anomaly, as it occurs only on rhub.
* Fedora Linux, R-devel, clang, gfortran
* ERRORs: 0
* WARNINGs: 0
* NOTEs: 1
* errors: 0
* warnings: 0
* notes: 1
- checking HTML version of manual ... NOTE
- Skipping checking HTML validation: no command 'tidy' found
- This NOTE appears to be an anomaly, as it occurs only on rhub.
Expand All @@ -79,4 +83,3 @@ We checked 1 reverse dependencies, comparing R CMD check results across CRAN and

* We saw 0 new problems
* We failed to check 0 packages

2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

4 changes: 2 additions & 2 deletions docs/articles/matsindf.html

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

4 changes: 2 additions & 2 deletions docs/articles/midf_apply_primer.html

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

6 changes: 3 additions & 3 deletions docs/authors.html

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

2 changes: 1 addition & 1 deletion docs/index.html

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

14 changes: 12 additions & 2 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ articles:
iris_pca: iris_pca.html
matsindf: matsindf.html
midf_apply_primer: midf_apply_primer.html
last_built: 2023-05-04T15:50Z
last_built: 2023-05-23T19:38Z

2 changes: 1 addition & 1 deletion docs/reference/UKEnergy2000.html

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

Loading

0 comments on commit c8f8ba9

Please sign in to comment.