Description Usage Arguments Details Value Author(s) See Also Examples
array2df: Convert multidimensional array into matrix or data.frame
The "wide-format" array is converted into a "long-format" matrix
or
data.frame
.
1 2 3 4 5 6 7 |
x |
|
levels |
If If If
|
matrix |
If |
label.x |
Name for the column containing the |
na.rm |
should rows where the value of |
If the resulting data.frame
is too large to fit in memory, a
matrix
might help.
The main benefit of this function is that it uses matrices as long as possible. This can give large advantages in terms of memory consumption.
A data.frame or matrix with prod (dim (x))
rows and length (dim (x)) + 1
columns.
Claudia Beleites
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | a <- arrayhelpers:::a
a
array2df (a)
array2df (a, matrix = TRUE)
array2df (a, levels = list(NULL, x = NA, c = NULL), label.x = "value")
array2df (a, levels = list(NULL, x = TRUE, c = c ("foo", "bar")), label.x = "value")
summary (array2df (a,
levels = list(NULL, x = NA, c = c ("foo", "bar")),
label.x = "value"))
summary (array2df (a,
levels = list(NULL, x = NA, c = c ("foo", "bar")),
label.x = "value",
matrix = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.