moveColumnsToFront: Move Columns to the Left

View source: R/column.R

moveColumnsToFrontR Documentation

Move Columns to the Left

Description

Move columns of a data frame or matrix to the left

Usage

moveColumnsToFront(x, columns = NULL)

Arguments

x

data frame

columns

vector of column names

Value

data frame or matrix with columns being the leftmost columns

Examples

x <- data.frame(a = 1:5, b = 2:6, c = 3:7)
  
moveColumnsToFront(x, "b")
moveColumnsToFront(x, c("b", "a"))
  

KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.