rotate: Rotates Data

Description Usage Arguments Value Author(s) Examples

View source: R/rotate.r

Description

The function implements the rotation of a vector, a matrix or a 3-dimensional array.

Usage

1
rotate(A, grad = 90)

Arguments

A

Is a vector, a matrix or a 3-dimensional array.

grad

Can be set to 0, 90, 180, 270, -90, -180 or -270. Defaults to grad = 90.

Value

Returns the rotated data.

Author(s)

Joern Schulz, [email protected].

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Rotation of a vector
(x <- c(1:5))
rotate(x,270)
rm(x)

# Rotation of a matrix
(A <- matrix(1:15, nrow=3))
rotate(A, -90)
rm(A)

# Rotation of an array
(A <- array(1:20, c(2,5,2)))
rotate(A, 180)
rm(A)

PET documentation built on May 2, 2019, 2:43 a.m.