From 94b050262ea89092736e70e2c935e4a38d14d969 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Sep 2022 19:20:52 +0200 Subject: [PATCH] add option for use_Symbols --- R/format_table.R | 11 +++++++---- man/format_table.Rd | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/R/format_table.R b/R/format_table.R index 8f02afe5b..2d4489a75 100644 --- a/R/format_table.R +++ b/R/format_table.R @@ -32,9 +32,10 @@ #' with a scientific format (e.g., 4.24e5), else as truncated values (as "> 1000" #' and "< 1/1000"). #' @param use_symbols Logical, if `TRUE`, column names that refer to particular -#' effectsizes (like Phi, Omega or Epsilon) include the related unicode-character -#' instead of the written name. This only works on Windows for R >= 4.2, and on -#' OS X or Linux for R >= 4.0. +#' effectsizes (like Phi, Omega or Epsilon) include the related unicode-character +#' instead of the written name. This only works on Windows for R >= 4.2, and on +#' OS X or Linux for R >= 4.0. It is possible to define a global option for this +#' setting, see 'Note'. #' @param ... Arguments passed to or from other methods. #' @inheritParams format_p #' @inheritParams format_value @@ -43,6 +44,8 @@ #' @seealso Vignettes [Formatting, printing and exporting tables](https://easystats.github.io/insight/articles/display.html) #' and [Formatting model parameters](https://easystats.github.io/parameters/articles/model_parameters_formatting.html). #' +#' @note `options(insight_use_symbols = TRUE)` override the `use_symbols` argument +#' and always displays symbols, if possible. #' @examples #' format_table(head(iris), digits = 1) #' @@ -75,7 +78,7 @@ format_table <- function(x, zap_small = FALSE, preserve_attributes = FALSE, exact = TRUE, - use_symbols = FALSE, + use_symbols = getOption("insight_use_symbols", FALSE), verbose = TRUE, ...) { # sanity check diff --git a/man/format_table.Rd b/man/format_table.Rd index 36af71abb..4ee0858ec 100644 --- a/man/format_table.Rd +++ b/man/format_table.Rd @@ -18,7 +18,7 @@ format_table( zap_small = FALSE, preserve_attributes = FALSE, exact = TRUE, - use_symbols = FALSE, + use_symbols = getOption("insight_use_symbols", FALSE), verbose = TRUE, ... ) @@ -64,7 +64,8 @@ and "< 1/1000").} \item{use_symbols}{Logical, if \code{TRUE}, column names that refer to particular effectsizes (like Phi, Omega or Epsilon) include the related unicode-character instead of the written name. This only works on Windows for R >= 4.2, and on -OS X or Linux for R >= 4.0.} +OS X or Linux for R >= 4.0. It is possible to define a global option for this +setting, see 'Note'.} \item{verbose}{Toggle messages and warnings.} @@ -81,6 +82,10 @@ separate columns for lower and upper confidence interval values). Furthermore, column names are formatted as well. Note that \code{format_table()} converts all columns into character vectors! } +\note{ +\code{options(insight_use_symbols = TRUE)} override the \code{use_symbols} argument +and always displays symbols, if possible. +} \examples{ format_table(head(iris), digits = 1)