Learn R Programming

cayleyR (version 0.2.1)

invert_path: Invert a Path of Operations

Description

Reverses and inverts a sequence of operations. "1" (shift left) becomes "2" (shift right) and vice versa. "3" (reverse) stays the same.

Usage

invert_path(path)

Value

Character vector of inverted operations in reverse order

Arguments

path

Character vector of operations

Examples

Run this code
invert_path(c("1", "3", "2"))
invert_path(c("1", "1", "3"))

Run the code above in your browser using DataLab