R/arrange_columns.R

Defines functions arrange_cols

Documented in arrange_cols

#' Move a set of columns to the left-hand side of a data frame
#' 
#' @param df A data frame
#' @param refcols A vector of the column names you would like to move to the left side of the dataframe (in order)
#' @export
arrange_cols <- function(df=df, refcols=refcols){
  df <- df[, c(refcols, setdiff(names(df), refcols))]
}
johnfrye/fryeR documentation built on Dec. 28, 2021, 6:20 p.m.