moveCol: Moves a data.frame column to a new position

Description Usage Arguments Details Value

Description

Moves a data.frame column to a new position

Usage

1
moveCol(df, from = "last", to = 1)

Arguments

df

An R data.frame

from

an integer indicating the current position of the column to move.

to

an integer indicating the target position of the column to move.

Details

This function does not work with data tables. The default position for 'from' is the last column of the data.frame.

Value

A data.frame identical to the input data.frame in terms of contents but with reordered columns.


hmenag1/hmUtils documentation built on May 17, 2019, 4:34 p.m.