Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

arot

Rotates an array about two specified dimensions


Description

Rotates an array about two specified dimensions by any number of 90 degree turns

Usage

arot(a, rights = 1,pair=1:2)

Arguments

a

The array to be rotated

rights

Integer; number of right angles to turn

pair

A two-element vector containing the dimensions to rotate with default meaning to rotate about the first two dimensions

Note

Function arot() is not exactly equivalent to octave's rotdim(); in arot() the order of the elements of pair matters because the rotation is clockwise when viewed in the (pair[1],pair[2]) direction. Compare octave's rotdim() in which pair is replaced with sort(pair).

Note also that the rotation is about the first two dimensions specified by pair but if pair has more than two elements then these dimensions are also permuted.

Also note that function arot() does not treat singleton dimensions specially.

Author(s)

Robin K. S. Hankin

See Also

Examples

a <- array(1:16,rep(2,4))
arot(a)

magic

Create and Investigate Magic Squares

v1.5-9
GPL-2
Authors
Robin K. S. Hankin
Initial release
2018-09-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.