swap: swap function

Description Usage Arguments Examples

Description

This function allows you to swap the position of two elements of a vector

Usage

1
swap(x, from, to)

Arguments

x

a vector

from

the first element to swap

to

the second element to swap

Examples

1
2
x <- c(1, 2, 3)
swap(x, 1, 3)

alexpavlakis/anagrammeR documentation built on May 9, 2019, 3:55 a.m.