| 1 |
|
| 2 |
```{r, include = FALSE} |
| 3 |
knitr::opts_chunk$set( |
| 4 |
collapse = TRUE, |
| 5 |
comment = "#>" |
| 6 |
) |
| 7 |
|
| 8 |
library(tidyselect) |
| 9 |
library(magrittr) |
| 10 |
|
| 11 |
# For examples |
| 12 |
rename <- function(.x, ..., .strict = TRUE) { |
| 13 |
pos <- eval_rename(rlang::expr(c(...)), .x, strict = .strict) |
| 14 |
names(.x)[pos] <- names(pos) |
| 15 |
.x |
| 16 |
} |
| 17 |
select <- function(.x, ..., .strict = TRUE) { |
| 18 |
pos <- eval_select(rlang::expr(c(...)), .x, strict = .strict) |
| 19 |
rlang::set_names(.x[pos], names(pos)) |
| 20 |
} |
| 21 |
|
| 22 |
# Better printing |
| 23 |
mtcars <- tibble::as_tibble(mtcars) |
| 24 |
iris <- tibble::as_tibble(iris) |
| 25 |
options( |
| 26 |
tibble.print_min = 4, |
| 27 |
tibble.print_max = 4 |
| 28 |
) |
| 29 |
|
| 30 |
# Fix Latex error |
| 31 |
options( |
| 32 |
cli.unicode = FALSE |
| 33 |
) |
| 34 |
``` |