Skip to content

Commit

Permalink
deal with non-ASCII characters
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Sep 13, 2023
1 parent e0ce62c commit 13131d2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
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,

Check warning on line 31 in R/plot.dw_data_tabulate.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.dw_data_tabulate.R,line=31,col=41,[numeric_leading_zero_linter] Include the leading zero for fractional numeric constants.
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,

Check warning on line 70 in R/plot.dw_data_tabulate.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.dw_data_tabulate.R,line=70,col=40,[numeric_leading_zero_linter] Include the leading zero for fractional numeric constants.
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
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.

0 comments on commit 13131d2

Please sign in to comment.