Skip to content

Commit

Permalink
Update snapshots (#302)
Browse files Browse the repository at this point in the history
* Update snapshots

* skip tests on devel

* deal with non-ASCII characters

* fix spelling workflow
  • Loading branch information
IndrajeetPatil authored Sep 13, 2023
1 parent 9f77185 commit b3bd3e1
Show file tree
Hide file tree
Showing 12 changed files with 461 additions and 232 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Suggests:
splines,
testthat (>= 3.1.7),
tidygraph,
vdiffr (>= 1.0.5)
vdiffr (>= 1.0.6)
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
Expand Down
40 changes: 25 additions & 15 deletions R/plot.dw_data_tabulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,50 @@
#' @param error_bar Logical. Should error bars be displayed?
#' If `TRUE`, confidence intervals computed using the Wilson method are shown.
#' See Brown et al. (2001) for details.
#' @param ci Confidence Interval (CI) level. Default to `0.95` (95%).
#' @param fill_col Color to use for category columns (default: "#87CEFA").
#' @param color_error_bar Color to use for error bars (default: "#607B8B").
#' @param ci Confidence Interval (CI) level. Defaults to `0.95` (`95%`).
#' @param fill_col Color to use for category columns (default: `"#87CEFA"`).
#' @param color_error_bar Color to use for error bars (default: `"#607B8B"`).
#' @param ... Unused
#'
#' @references
#' Brown, L. D., Cai, T. T., & DasGupta, A. (2001).
#' Brown, L. D., Cai, T. T., & Dasgupta, A. (2001).
#' Interval estimation for a binomial proportion.
#' _Statistical Science, 16_(2), 101133. \doi{10.1214/ss/1009213286}
#' _Statistical Science_, _16_(2), 101-133. \doi{10.1214/ss/1009213286}
#'
#' @rdname plot.dw_data_tabulate
#' @export

plot.dw_data_tabulates <- function(x, label_values = TRUE,
show_na = c("if_any", "always", "never"),
na_label = "(Missing)",
error_bar = TRUE, ci = .95,
error_bar = TRUE,
ci = .95,
fill_col = "#87CEFA",
color_error_bar = "#607B8B",
...) {
show_na <- match.arg(show_na, choices = c("if_any", "always", "never"))
if (length(x) == 1) {
if (length(x) == 1L) {
plot.dw_data_tabulate(
x[[1]],
label_values = label_values,
show_na = show_na, na_label = na_label,
error_bar = error_bar, ci = ci,
fill_col = fill_col, color_error_bar = color_error_bar
show_na = show_na,
na_label = na_label,
error_bar = error_bar,
ci = ci,
fill_col = fill_col,
color_error_bar = color_error_bar
)
} else {
lapply(x, plot.dw_data_tabulate,
lapply(
x,
plot.dw_data_tabulate,
label_values = label_values,
show_na = show_na, na_label = na_label,
error_bar = error_bar, ci = ci,
fill_col = fill_col, color_error_bar = color_error_bar
show_na = show_na,
na_label = na_label,
error_bar = error_bar,
ci = ci,
fill_col = fill_col,
color_error_bar = color_error_bar
)
}
}
Expand All @@ -57,7 +66,8 @@ plot.dw_data_tabulates <- function(x, label_values = TRUE,
plot.dw_data_tabulate <- function(x, label_values = TRUE,
show_na = c("if_any", "always", "never"),
na_label = "(Missing)",
error_bar = TRUE, ci = .95,
error_bar = TRUE,
ci = .95,
fill_col = "#87CEFA",
color_error_bar = "#607B8B",
...) {
Expand Down
2 changes: 1 addition & 1 deletion R/see-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' scales for 'ggplot2'. Color scales are based on
#' <https://materialui.co/colors>.
#'
#' References: Lüdecke et al. (2021) \doi{10.21105/joss.03393}.
#' References: Luedecke et al. (2021) \doi{10.21105/joss.03393}.
#'
#' @docType package
#' @aliases see see-package
Expand Down
4 changes: 2 additions & 2 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Biserial
Blomqvist’s
Bluebrown
BossekJakob
CEFA
CMD
Cai
DOI
DasGupta
Dasgupta
Dom
GGMs
GeomViolinHalf
Geoms
HDI
Hoeffding’s
Luedecke
MPE
Mattan
Modelling
Expand Down
10 changes: 5 additions & 5 deletions man/plot.dw_data_tabulate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/see-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# graphics engine changed in R 4.1, and so snapshots generated on
# previous R version won't be compatible
if (require("testthat") && require("vdiffr") && getRversion() > "4.1.0") {
# graphics engine changed in these versions, and so snapshots generated on
# previous R version won't work
if (require("testthat") && require("vdiffr") && getRversion() > "4.1.0" && getRversion() < "4.4.0") {
library(testthat)
library(see)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b3bd3e1

Please sign in to comment.