#' @title select columns to back
#' https://gist.githubusercontent.com/romainfrancois/5363c96646bb164f77fac2610d23b126/raw/0e4454a7c833d18998cac91df6403ad0f95d0eaf/frontback.md
#' @description select columns to back
#' @param df dataframe
#'
#' @return dataframe
#'
#' @examples
#' col_back(iris, Sepal.Length) %>% head()
#'
#' @import purrr
#' @import dplyr
#' @import rlang
#'
#' @rdname col_back
#' @export
#'
#
col_back <- function(data, ...){
dots <- quos(...)
# negate each expression
ndots <- map(dots, function(q) expr(-!!q) )
# select the negated (rm the columns) and then select them back
select( data, !!!ndots, !!!dots )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.