Skip to content

Commit

Permalink
global options
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Nov 15, 2024
1 parent 3ae62a4 commit dbf2d19
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 39 deletions.
8 changes: 4 additions & 4 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.onAttach <- function(lib, pkg) {
msg <- c(
"Please cite the software that makes your work possible.",
'For bibliographic info, type: citation("package_name")',
"Silence this message with: options(open_source_promo = FALSE)"
"Please cite the software developers who make your work possible.",
'Bibliographic info: citation("package_name")',
"Silence this message: options(marginaleffects_startup_message = FALSE)"
)
msg <- paste(msg, collapse = "\n")
if (isTRUE(getOption("open_source_promo", TRUE))) {
if (isTRUE(getOption("marginaleffects_startup_message", TRUE))) {
packageStartupMessage(msg)
}
invisible()
Expand Down
19 changes: 8 additions & 11 deletions man-roxygen/options.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#' @section Global options:
#'
#'
#' The behavior of `marginaleffects` functions can be modified by setting global options.
#'
#' Disable some safety checks and warnings:
#'
#' ```r
#' options(marginaleffects_safe = FALSE)
#' ```
#'
#' Omit some columns from the printed output:
#' Disable some safety checks and warnings:
#'
#' ```r
#' options(marginaleffects_print_omit = c("p.value", "s.value"))`
#' ```
#' * `options(marginaleffects_startup_message = FALSE)`
#' - Disable the startup message printed on `library(marginaleffects)`.
#' * `options(marginaleffects_safe = FALSE)`
#' - Disable safety checks and warnings.
#' * `options(marginaleffects_print_omit = c("p.value", "s.value"))`
#' - Omit some columns from the printed output.
#'
#' Enforce lean return objects, sans information about the original model and
#' data, and other ancillary attributes. Note that this will disable some
Expand Down
22 changes: 14 additions & 8 deletions man/comparisons.Rd

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

22 changes: 14 additions & 8 deletions man/predictions.Rd

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

22 changes: 14 additions & 8 deletions man/slopes.Rd

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

0 comments on commit dbf2d19

Please sign in to comment.