pull_columns: Pull columns in a dataframe to the front

View source: R/1_utilities.R

pull_columnsR Documentation

Pull columns in a dataframe to the front

Description

Pull columns in a dataframe to the front

Usage

pull_columns(df, first_cols, verbose = TRUE)

Arguments

df

data.frame

first_cols

character vector: columns to be pulled to the front

verbose

TRUE (default) or FALSE

Value

dataframe with re-ordered columns

Examples

df <- data.frame(
   symbol = c('A1BG', 'A2M'),
   id     = c('1',    '2'),
   name   = c('alpha-1-B glycoprotein', 'alpha-2-macroglobulin'),
   type   = c('proteincoding', 'proteincoding'))
first_cols <- c('id', 'symbol', 'location', 'uniprot')
pull_columns(df, first_cols)

bhagwataditya/autonomics documentation built on Nov. 1, 2024, 5:47 a.m.