swap: swap elements at i and i+1 of a vector

View source: R/doofa.R

swapR 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);

doofa documentation built on June 22, 2024, 7:39 p.m.

Related to swap in doofa...