as.matrix.afaces: Converts an afaces object to a wide matrix

Description Usage Arguments Examples

View source: R/afaces.R

Description

If the array comes as an object with (i, j, k) pixels, returns a matrix of (k, i*j) pixels. Basically takes all the pixels from top to bottom and left to right, convert them as a vector and turns them into rows of the wide matrix.

Usage

1
2
## S3 method for class 'afaces'
as.matrix(x, colnames = FALSE, ...)

Arguments

x

afaces object

colnames

logical, whether to retain rows/cols names of the afaces object

...

only used to maintain generic as.matrix

Examples

1
2
3
4
a <- array(1:27, dim=rep(3, 3))
a <- afaces(a)
a[,,1]
as.matrix(a)

vbonhomme/eigenfaces documentation built on May 3, 2019, 4:35 p.m.