View source: R/front_and_back.R
back | R Documentation |
Cool functions taken from @roman_francois Twitter post. https://gist.github.com/romainfrancois/5363c96646bb164f77fac2610d23b126
back(data, ...)
front(data, ...)
data |
A data frame or tibble |
... |
Column(s) in the data frame to be moved |
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.
A data frame
library(dplyr)
back(iris, Species) %>% head
back(iris, Species, starts_with("Petal")) %>% head
front(iris, Species) %>% head
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.