From acf8cc45e1bdd375ab9ababcc9da5fcba478568b Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 23 Jun 2024 10:02:20 +0200 Subject: [PATCH] docs, news --- DESCRIPTION | 2 +- NEWS.md | 5 +++++ R/data_summary.R | 6 +++--- R/data_tabulate.R | 2 +- man/data_summary.Rd | 6 +++--- man/data_tabulate.Rd | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0a7fb9594..c56e3f9dd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: datawizard Title: Easy Data Wrangling and Statistical Transformations -Version: 0.11.0.3 +Version: 0.11.0.4 Authors@R: c( person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = "aut", comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")), diff --git a/NEWS.md b/NEWS.md index ada1f08ea..8e5001f77 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,11 @@ BREAKING CHANGES +* The argument `include_na` in `data_tabulate()` and `data_summary()` has been + renamed into `remove_na`. Consequently, to mimic former behaviour, `FALSE` and + `TRUE` need to be switched (i.e. `remove_na = TRUE` is equivalent to the former + `include_na 0 FALSE`). + * Class names for objects returned by `data_tabulate()` have been changed to `datawizard_table` and `datawizard_crosstable` (resp. the plural forms, `*_tables`), to provide a clearer and more consistent naming scheme. diff --git a/R/data_summary.R b/R/data_summary.R index f77ebe013..7662d0c94 100644 --- a/R/data_summary.R +++ b/R/data_summary.R @@ -8,9 +8,9 @@ #' @param by Optional character string, indicating the name of a variable in `x`. #' If supplied, the data will be split by this variable and summary statistics #' will be computed for each group. -#' @param remove_na Logical. If `TRUE`, missing values are included as a level -#' in the grouping variable. If `FALSE`, missing values are omitted from the -#' grouping variable. +#' @param remove_na Logical. If `TRUE`, missing values are omitted from the +#' grouping variable. If `FALSE` (default), missing values are included as a +#' level in the grouping variable. #' @param ... One or more named expressions that define the new variable name #' and the function to compute the summary statistic. Example: #' `mean_sepal_width = mean(Sepal.Width)`. The expression can also be provided diff --git a/R/data_tabulate.R b/R/data_tabulate.R index 4c0aa10b3..952f921d9 100644 --- a/R/data_tabulate.R +++ b/R/data_tabulate.R @@ -15,7 +15,7 @@ #' factor levels are dropped from the frequency table. #' @param name Optional character string, which includes the name that is used #' for printing. -#' @param remove_na Logical, if `TRUE`, missing values are included in the +#' @param remove_na Logical, if `FALSE`, missing values are included in the #' frequency or crosstable, else missing values are omitted. #' @param collapse Logical, if `TRUE` collapses multiple tables into one larger #' table for printing. This affects only printing, not the returned object. diff --git a/man/data_summary.Rd b/man/data_summary.Rd index 70d2e2576..24cfa1a9f 100644 --- a/man/data_summary.Rd +++ b/man/data_summary.Rd @@ -22,9 +22,9 @@ summary function \code{n()} can be used to count the number of observations.} If supplied, the data will be split by this variable and summary statistics will be computed for each group.} -\item{remove_na}{Logical. If \code{TRUE}, missing values are included as a level -in the grouping variable. If \code{FALSE}, missing values are omitted from the -grouping variable.} +\item{remove_na}{Logical. If \code{TRUE}, missing values are omitted from the +grouping variable. If \code{FALSE} (default), missing values are included as a +level in the grouping variable.} } \value{ A data frame with the requested summary statistics. diff --git a/man/data_tabulate.Rd b/man/data_tabulate.Rd index 6f572a05a..2feadf3a9 100644 --- a/man/data_tabulate.Rd +++ b/man/data_tabulate.Rd @@ -62,7 +62,7 @@ factor levels are dropped from the frequency table.} \item{weights}{Optional numeric vector of weights. Must be of the same length as \code{x}. If \code{weights} is supplied, weighted frequencies are calculated.} -\item{remove_na}{Logical, if \code{TRUE}, missing values are included in the +\item{remove_na}{Logical, if \code{FALSE}, missing values are included in the frequency or crosstable, else missing values are omitted.} \item{proportions}{Optional character string, indicating the type of