Description Usage Arguments Value Author(s) See Also Examples
Converts the array, a
, with 4 dimensions, c(d1, d2, d3, d4)
,
into a matrix with d1*d2
rows and d3*d4
columns.
1 | Array2Matrix(a)
|
a |
Array with 4 dimensions. |
A matrix. If a
has the attribute mp
, the transformed attribute is returned as well.
See ArrayAround
for more information about mp
.
Florian Gerber, flora.fauna.gerber@gmail.com.
Index, ArrayAround
.
1 2 3 4 5 6 7 | a <- array(data = 1:16, dim = c(2, 2, 2, 2))
Array2Matrix(a = a)
attr(a, "mp") <- c(1, 2, 2, 1)
Array2Matrix(a = a)
Array2Matrix(ArrayAround(data = a, mp = c(1, 1, 1, 1),
size = c(1, 1, 2, 2)))
|
Loading required package: ggplot2
[,1] [,2] [,3] [,4]
[1,] 1 5 9 13
[2,] 2 6 10 14
[3,] 3 7 11 15
[4,] 4 8 12 16
[,1] [,2] [,3] [,4]
[1,] 1 5 9 13
[2,] 2 6 10 14
[3,] 3 7 11 15
[4,] 4 8 12 16
attr(,"mp")
[1] 3 2
[,1] [,2] [,3] [,4]
[1,] 1 5 9 13
[2,] 2 6 10 14
[3,] 3 7 11 15
[4,] 4 8 12 16
attr(,"mp")
[1] 1 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.