Skip to content

Commit

Permalink
BUG FIX: col-/rowTabulates() reported on class rather than storage ty…
Browse files Browse the repository at this point in the history
…pe of the input data [#275]
  • Loading branch information
HenrikBengtsson committed Jan 6, 2025
1 parent bed6981 commit 772e61c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: matrixStats
Version: 1.4.1-9012
Version: 1.4.1-9013
Depends:
R (>= 3.4.0)
Suggests:
Expand Down
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
[2024-04-10]. If not explicitly specified, a deprecation warning is
now produced every 10:th call not specifying the `ties.method`
argument.


## Bug Fixes

* The error message of `colTabulates()` and `rowTabulates()`
asserting that double values are passed, reported on the class of
the input data, not the storage type.


# Version 1.4.1 [2024-09-06]

Expand Down
4 changes: 2 additions & 2 deletions R/rowTabulates.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rowTabulates <- function(x, rows = NULL, cols = NULL, values = NULL, ..., useNam
} else if (is.logical(x)) {
} else if (is.raw(x)) {
} else {
stop(sprintf("Argument '%s' is not integer, logical, or raw: %s", "x", class(x)[1]))
stop(sprintf("Argument '%s' is not integer, logical, or raw: %s", "x", storage.mode(x)))
}

# Apply subset
Expand Down Expand Up @@ -102,7 +102,7 @@ colTabulates <- function(x, rows = NULL, cols = NULL, values = NULL, ..., useNam
} else if (is.logical(x)) {
} else if (is.raw(x)) {
} else {
stop(sprintf("Argument '%s' is not integer, logical, or raw: %s", "x", class(x)[1]))
stop(sprintf("Argument '%s' is not integer, logical, or raw: %s", "x", storage.mode(x)))
}

# Apply subset
Expand Down

0 comments on commit 772e61c

Please sign in to comment.