Learn R Programming

cape (version 2.0.2)

rotate.mat: Rotate a matrix 90 degrees clockwise

Description

This function rotates an image such that when it is plotted by image it is plotted in the same orientation that the matrix is printed to the screen.

Usage

rotate.mat(mat)

Arguments

mat
A matrix to be rotated

Value

A matrix that is rotated 90 degrees clockwise from the original matrix is returned

Examples

Run this code
mat <- matrix(1:10, ncol = 10, nrow = 10)
rot.mat <- rotate.mat(mat)
rot.mat

Run the code above in your browser using DataLab