diff --git a/DESCRIPTION b/DESCRIPTION index ca8c36a2..22ff768e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: report Type: Package Title: Automated Reporting of Results and Statistical Models -Version: 0.6.3.1 +Version: 0.6.3.2 Authors@R: c(person(given = "Dominique", family = "Makowski", @@ -91,7 +91,6 @@ VignetteBuilder: knitr Encoding: UTF-8 Language: en-US -RoxygenNote: 7.3.3 Config/testthat/edition: 3 Config/Needs/website: rstudio/bslib, @@ -161,3 +160,4 @@ Collate: 'utils_misspelled_variables.R' 'zzz.R' Roxygen: list(markdown = TRUE) +Config/roxygen2/version: 8.0.0 diff --git a/NEWS.md b/NEWS.md index 5a417704..1f4f482b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ Bug fixes +* `report_participants()`: fix CRAN failure on r-devel due to `row names contain missing values` error by replacing `datawizard::data_tabulate()` with a direct `table()` call for country and race frequency tables (#593). + * Fix `report()` crash when character vector has only one unique value (#578). # report 0.6.3 diff --git a/R/report.character.R b/R/report.character.R index 0035911b..b6d38457 100644 --- a/R/report.character.R +++ b/R/report.character.R @@ -107,7 +107,11 @@ report_parameters.character <- function( } n_entries_actual <- min(n_entries, length(param_text)) - as.report_parameters(param_text, summary = param_text[1:n_entries_actual], ...) + as.report_parameters( + param_text, + summary = param_text[1:n_entries_actual], + ... + ) } diff --git a/R/report_participants.R b/R/report_participants.R index 3025b8e4..230537d3 100644 --- a/R/report_participants.R +++ b/R/report_participants.R @@ -560,12 +560,12 @@ report_participants <- function( } else { data[[country]] <- as.character(data[[country]]) data[which(data[[country]] %in% c(NA, "NA")), country] <- "missing" - frequency_table <- as.data.frame( - datawizard::data_tabulate(data[[country]]), + freq_tbl <- table(data[[country]]) + frequency_table <- data.frame( + Value = names(freq_tbl), + Percent = as.numeric(freq_tbl) / nrow(data) * 100, stringsAsFactors = FALSE - )[c(2, 4)] - names(frequency_table)[2] <- "Percent" - frequency_table <- frequency_table[-which(is.na(frequency_table$Value)), ] + ) frequency_table <- frequency_table[order(-frequency_table$Percent), ] upper <- frequency_table[which(frequency_table$Percent >= threshold), ] lower <- frequency_table[which(frequency_table$Percent < threshold), ] @@ -594,12 +594,12 @@ report_participants <- function( } else { data[[race]] <- as.character(data[[race]]) data[which(data[[race]] %in% c(NA, "NA")), race] <- "missing" - frequency_table <- as.data.frame( - datawizard::data_tabulate(data[[race]]), + freq_tbl <- table(data[[race]]) + frequency_table <- data.frame( + Value = names(freq_tbl), + Percent = as.numeric(freq_tbl) / nrow(data) * 100, stringsAsFactors = FALSE - )[c(2, 4)] - names(frequency_table)[2] <- "Percent" - frequency_table <- frequency_table[-which(is.na(frequency_table$Value)), ] + ) frequency_table <- frequency_table[order(-frequency_table$Percent), ] upper <- frequency_table[which(frequency_table$Percent >= threshold), ] lower <- frequency_table[which(frequency_table$Percent < threshold), ] diff --git a/man/reexports.Rd b/man/reexports.Rd index 87b8b45b..eef46699 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -13,6 +13,6 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{insight}{\code{\link[insight]{display}}, \code{\link[insight:display]{print_html}}, \code{\link[insight:display]{print_md}}} + \item{insight}{\code{\link[insight:display]{display()}}, \code{\link[insight:print_html]{print_html()}}, \code{\link[insight:print_md]{print_md()}}} }} diff --git a/man/report-package.Rd b/man/report-package.Rd index ce41d492..86d18867 100644 --- a/man/report-package.Rd +++ b/man/report-package.Rd @@ -28,6 +28,7 @@ Useful links: Authors: \itemize{ + \item Rémi Thériault \email{remi.theriault@mail.mcgill.ca} (\href{https://orcid.org/0000-0003-4315-6788}{ORCID}) \item Dominique Makowski \email{dom.makowski@gmail.com} (\href{https://orcid.org/0000-0001-5375-9967}{ORCID}) \item Daniel Lüdecke \email{d.luedecke@uke.de} (\href{https://orcid.org/0000-0002-8895-3206}{ORCID}) \item Indrajeet Patil \email{patilindrajeet.science@gmail.com} (\href{https://orcid.org/0000-0003-1995-6531}{ORCID}) diff --git a/man/report.compare.loo.Rd b/man/report.compare.loo.Rd index ae839530..7e715b70 100644 --- a/man/report.compare.loo.Rd +++ b/man/report.compare.loo.Rd @@ -7,7 +7,7 @@ \method{report}{compare.loo}(x, include_IC = TRUE, include_ENP = FALSE, ...) } \arguments{ -\item{x}{An object of class \link[brms:loo_compare.brmsfit]{brms::loo_compare}.} +\item{x}{An object of class \link[brms:loo_compare]{brms::loo_compare}.} \item{include_IC}{Whether to include the information criteria (IC).}