swap {doofa}R Documentation

swap elements at i and i+1 of a vector

Description

swap elements at i and i+1 of a vector

Usage

swap(x, i)

Arguments

x

a vector

i

a positive integer, less than length of x

Value

a vector with swapped elements

Examples

swap(c(1,2,3),2);

[Package doofa version 1.0 Index]