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
)


tidyverse/tidyselect documentation built on Jan. 28, 2020, 1:13 a.m.