swap | R Documentation |
swap elements at i and i+1 of a vector
swap(x, i)
x |
a vector |
i |
a positive integer, less than length of x |
a vector with swapped elements
swap(c(1,2,3),2);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.