Learn R Programming

fuj (version 0.2.1)

flip: Flip

Description

Flip an object.

Usage

flip(x, ...)

# S3 method for default flip(x, ...)

# S3 method for matrix flip(x, by = c("rows", "columns"), keep_rownames = NULL, ...)

# S3 method for data.frame flip(x, by = c("rows", "columns"), keep_rownames = NULL, ...)

Value

A vector of values, equal length of x that is reversed or a data frame with flipped rows/columns

Arguments

x

An object

...

Additional arguments passed to methods

by

Flip by "rows" or "columns" (partial matches accepted)

keep_rownames

Logical, if TRUE will not reset row names; NULL

Examples

Run this code
flip(letters[1:3])
flip(seq.int(9, -9, by = -3))
flip(head(iris))
flip(head(iris), keep_rownames = TRUE)
flip(head(iris), by = "col")

Run the code above in your browser using DataLab