rotate.left: Rotate matrix 90 degrees counter-clockwise

Description Usage Arguments Details Value Examples

View source: R/primitive.matrix.functions.R

Description

Rotate matrix 90 degrees counter-clockwise

Usage

1

Arguments

x

a 2d-matrix

Details

t(apply(x,2,rev))

Value

the given matrix rotated 90 degrees counter-clockwise

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
a<-matrix(1:9,3,3)
a
#     [,1] [,2] [,3]
#[1,]    1    4    7
#[2,]    2    5    8
#[3,]    3    6    9
rotate.left(a)
#     [,1] [,2] [,3]
#[1,]    7    8    9
#[2,]    4    5    6
#[3,]    1    2    3

nobodyinperson/matrixutils documentation built on May 23, 2019, 9:31 p.m.