powered by
swap elements at i and i+1 of a vector
swap(x, i)
a vector with swapped elements
a vector
a positive integer, less than length of x
swap(c(1,2,3),2);
Run the code above in your browser using DataLab