back: Move selected columns to front and back

View source: R/front_and_back.R

backR Documentation

Move selected columns to front and back

Description

Cool functions taken from @roman_francois Twitter post. https://gist.github.com/romainfrancois/5363c96646bb164f77fac2610d23b126

Usage

back(data, ...)

front(data, ...)

Arguments

data

A data frame or tibble

...

Column(s) in the data frame to be moved

Details

Given a data frame or tibble, these functions will move selected columns to the front or to the back of the rest of the columns. Really a wrapper for dplyr::select() and dplyr::everything() but making cool use of tidyeval.

Value

A data frame

Examples

library(dplyr)
back(iris, Species) %>% head
back(iris, Species, starts_with("Petal")) %>% head
front(iris, Species) %>% head

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.