swapElements: Swap the position of two elements in a grid.

View source: R/repgrid-basicops.r

swapElementsR Documentation

Swap the position of two elements in a grid.

Description

Swap the position of two elements in a grid.

Usage

swapElements(x, pos1 = 1, pos2 = 1)

Arguments

x

repgrid object.

pos1

Column number of first element to be swapped (default=1).

pos2

Column number of second element to be swapped (default=1).

Value

repgrid object.

Examples

## 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

## End(Not run)


OpenRepGrid documentation built on May 31, 2023, 5:33 p.m.