angleOrderIndexes2d: Make indexes to order grid by angles in given dimensions.

View source: R/calc.r

angleOrderIndexes2dR Documentation

Make indexes to order grid by angles in given dimensions.

Description

Reorder indexes for constructs and elements are calculated using the coordinates of the given dimensions.

Usage

angleOrderIndexes2d(x, dim = c(1, 2), clockwise = TRUE)

Arguments

x

repgrid object that has been submitted to calcBiplotCoords.

dim

Dimensions used to calculate angles for reordering grid.

clockwise

Logical. Positive angles are clockwise with x axis as basis.

Value

A list containing the indexes to reorder the grid. The first list element for the constructs, the second for the elements indexes.

Examples

## Not run: 

   x <- randomGrid(15,30)      # make random grid
   i <- angleOrderIndexes2d(x) # make indexes for ordering
   x <- x[i[[1]], i[[2]]]      # reorder constructs and elements
   x                           # print grid

## End(Not run)
                 

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