From 8c2271f64c78965228088aa14bd82252e9ce3adb Mon Sep 17 00:00:00 2001 From: ncondits3 Date: Mon, 2 Oct 2023 16:51:06 -0400 Subject: [PATCH] Removed generic function for tally() so that it doesn't conflict with dplyr::tally(). --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/Analysis.R | 50 +++++++++++++++++++++++++----------------- R/humdrumR-package.R | 4 ++-- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/authors.html | 2 +- docs/index.html | 4 ++-- man/tally.Rd | 3 ++- 9 files changed, 41 insertions(+), 29 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c5ed8a68..10635648 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: humdrumR Title: humdrumR -Version: 0.7.0.0 +Version: 0.7.0.1 Authors@R: c(person("Nathaniel", "Condit-Schultz", email = "natcs@gatech.edu", role = c("aut", "cre")), person("Claire", "Arthur", email = "claire.arthur@gatech.edu", role = "aut")) Description: This package is a toolkit for the visualization, manipulation, and analysis of data encoded in the Humdrum syntax ( 1) { + for (i in seq_along(dimnames)) { + reorder <- order(apply(tab, i, sum), decreasing = TRUE) + tab <- apply(tab, seq_along(dimnames)[-i], '[', i = reorder) + } + } else { + tab <- sort(tab, decreasing = TRUE) + } - do.call('tally', c(as.list(fields), list(na.rm = na.rm, exclude = exclude))) + class(tab) <- 'table' } + new('humdrum.table', tab) } + #' @rdname tally #' @export diff --git a/R/humdrumR-package.R b/R/humdrumR-package.R index 662d5ebf..4a42f8c5 100644 --- a/R/humdrumR-package.R +++ b/R/humdrumR-package.R @@ -52,11 +52,11 @@ #' @importFrom numbers primeFactors #' @importFrom data.table data.table rbindlist setorder setindex set setorderv setcolorder copy as.data.table is.data.table frank CJ setnames setkey #' @importFrom scales ContinuousRange -#' @importFrom dplyr summarise select filter mutate pull reframe group_by ungroup summarize +#' @importFrom dplyr summarise select filter mutate pull reframe group_by ungroup summarize tally #' @importFrom tidyselect eval_select #' @importFrom tidyr pivot_wider pivot_longer #' @importFrom ggplot2 ggplot update_geom_defaults scale_color_gradientn scale_type aes geom_bar geom_point -#' @export summarise select filter mutate pull reframe group_by ungroup summarize +#' @export summarise select filter mutate pull reframe group_by ungroup summarize tally NULL diff --git a/docs/404.html b/docs/404.html index e9c18cbd..d1e190d5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -25,7 +25,7 @@ Georgia Tech CCMLab humdrumR - 0.7.0.0 + 0.7.0.1