powered by
Swap the position of two elements in a grid.
swapElements(x, pos1 = 1, pos2 = 1)
repgrid object.
repgrid
Column number of first element to be swapped (default=1).
Column number of second element to be swapped (default=1).
# NOT RUN { x <- randomGrid() swapElements(x, 1, 3) # swap elements 1 and 3 swapElements(x, 1:2, 3:4) # swap element 1 with 3 and 2 with 4 # } # NOT RUN { # }
Run the code above in your browser using DataLab