Skip to content

Commit

Permalink
Merge pull request #105 from mayer79/remove-special-case
Browse files Browse the repository at this point in the history
Remove special case of a one-column matrix in wcolMean()
  • Loading branch information
mayer79 authored Nov 14, 2023
2 parents f7e61e6 + bedf559 commit 29597c2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: hstats
Title: Interaction Statistics
Version: 1.1.0
Version: 1.1.1
Authors@R:
person("Michael", "Mayer", , "[email protected]", role = c("aut", "cre"))
Description: Fast, model-agnostic implementation of different H-statistics
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# hstats 1.1.1

## Other changes

- Removed an unnecessary special case when calculating column means.

# hstats 1.1.0

## Enhancements
Expand Down
4 changes: 0 additions & 4 deletions R/utils_calculate.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ fdummy <- function(x) {
#' @param w Optional case weights.
#' @returns A vector of column means.
wcolMeans <- function(x, w = NULL) {
if (NCOL(x) == 1L && is.atomic(x) && !is.factor(x) && is.null(w)) {
# stat::weighted.mean() is much slower than via colSums()
return(mean(x))
}
if (is.factor(x)) {
if (is.null(w)) {
return(colMeans_factor(x))
Expand Down
2 changes: 1 addition & 1 deletion packaging.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library(usethis)
use_description(
fields = list(
Title = "Interaction Statistics",
Version = "1.1.0",
Version = "1.1.1",
Description = "Fast, model-agnostic implementation of different H-statistics
introduced by Jerome H. Friedman and Bogdan E. Popescu (2008) <doi:10.1214/07-AOAS148>.
These statistics quantify interaction strength per feature, feature pair,
Expand Down

0 comments on commit 29597c2

Please sign in to comment.