R/fastplyr_options.R

Defines functions fastplyr_disable_informative_msgs fastplyr_enable_informative_msgs fastplyr_disable_optimisations fastplyr_enable_optimisations

Documented in fastplyr_disable_informative_msgs fastplyr_disable_optimisations fastplyr_enable_informative_msgs fastplyr_enable_optimisations

#' Setting global fastplyr options
#'
#' @name fastplyr_options
#'
#' @description
#' Helper functions to allow users to:
#' - Enable or disable optimisations for common functions package-wide
#' - Enable or disable informative messages
#'
#' @returns
#' Enables or disables fastplyr global options invisibly.
#'
#' @seealso [get_group_unaware_fns]
#'
#' @rdname fastplyr_options
#' @export
fastplyr_enable_optimisations <- function(){
  options(fastplyr.optimise = TRUE)
  cli::cli_inform(c("i" = "Function optimisations have been {cli::col_green('enabled')} package-wide"))
}
#' @rdname fastplyr_options
#' @export
fastplyr_disable_optimisations <- function(){
  options(fastplyr.optimise = FALSE)
  cli::cli_inform(c("i" = "Function optimisations have been {cli::col_red('disabled')} package-wide"))
}
#' @rdname fastplyr_options
#' @export
fastplyr_enable_informative_msgs <- function(){
  options(fastplyr.inform = TRUE)
  cli::cli_inform(c("i" = "Informative messages have been {cli::col_green('enabled')} package-wide"))
}
#' @rdname fastplyr_options
#' @export
fastplyr_disable_informative_msgs <- function(){
  options(fastplyr.inform = FALSE)
  cli::cli_inform(c("i" = "Informative messages have been {cli::col_red('disabled')} package-wide"))
}

Try the fastplyr package in your browser

Any scripts or data that you put into this service are public.

fastplyr documentation built on Nov. 21, 2025, 5:07 p.m.