Learn R Programming

tatoo (version 1.1.2)

flip_names: Flip names and multinames of a Composite Table

Description

The column names of the resulting Composite_table will be sorted lexically

Usage

flip_names(dat, id_vars)

Value

a Composite_table

Arguments

dat

A Composite_table

id_vars

a character vector of column names of dat. The selected columns will not be sorted lexically but kept to the left. If the columns have a multiname associated with them, they must be supplied in the format column_name.multiname.

Examples

Run this code

dat <- comp_table(
  cars1 = head(cars),
  cars2 = tail(cars),
  data.frame(id = LETTERS[1:6])
)

flip_names(dat)
flip_names(dat, id_vars = "id")
flip_names(dat, id_vars = c("id", "speed.cars1"))

Run the code above in your browser using DataLab