knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(tidyselect)
library(magrittr)

# For examples
rename <- function(.x, ..., .strict = TRUE) {
  pos <- eval_rename(rlang::expr(c(...)), .x, strict = .strict)
  names(.x)[pos] <- names(pos)
  .x
}
select <- function(.x, ..., .strict = TRUE) {
  pos <- eval_select(rlang::expr(c(...)), .x, strict = .strict)
  rlang::set_names(.x[pos], names(pos))
}

# Better printing
mtcars <- tibble::as_tibble(mtcars)
iris <- tibble::as_tibble(iris)
options(
  tibble.print_min = 4,
  tibble.print_max = 4
)

# Fix Latex error
options(
  cli.unicode = FALSE
)


lionel-/selectr documentation built on March 14, 2024, 10:04 p.m.