dot-SetColumnOrder: Set the column order of a data frame.

Description Usage Arguments Value Examples

Description

.SetColumnOrder() is an internal function that is not intended to be called by the user. It is called by other FIRST API methods.

Usage

1
.SetColumnOrder(df, col.order)

Arguments

df

A data frame

col.order

A character vector containing the names of the columns in df, in the desired column order.

Value

A data frame identical to the the data frame provided in the df argument, except with the columns in the order specified in the col.order argument. The returned data frame will ahve the same attributes as the data frame provided in the df argument.

Examples

1
2
my.df <- data.frame(col3 = 1:3, col1 = 4:6, col2: 7:9)
ordered.df <- .SetColumnOrder(my.df, c("col1", "col2", "col3"))

irwinsnet/firstapiR documentation built on Dec. 22, 2020, 5:13 p.m.