inst/test/code/group-by-rename-3.R

library(dplyr)

mt <- mtcars %>%
  as_tibble() %>%
  select(mpg, cyl, hp) %>%
  group_by(cyl) %>%
  slice(1:2)

mt %>%
  rename(Horsepower = hp, cyl = cyl)
seankross/mario documentation built on Dec. 22, 2021, 11:15 p.m.