R/hal9000.R

Defines functions hal9000

Documented in hal9000

utils::globalVariables(c("hal_quotes"))

#' HAL 9000 Quotes
#'
#' Prints a quote from the HAL 9000 robot from 2001: A Space Odyssey
#'
#' @importFrom utils data
#
hal9000 <- function() {
  utils::data("hal_quotes", envir = environment())

  # pick a HAL 9000 quote to print
  hal_says <- hal_quotes[sample(seq_along(hal_quotes), 1)]

  # special case, for David
  names <- Sys.info()[c(6, 7, 8)]
  if ("david" %in% names | "benkeser" %in% names) {
    hal_says <- hal_quotes[6]
  }
  print(hal_says)
}

Try the hal9001 package in your browser

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

hal9001 documentation built on Nov. 14, 2023, 5:08 p.m.