arrayToDataFrame: Convert Array to Data Frame

View source: R/arrayToDataFrame.R

arrayToDataFrameR Documentation

Convert Array to Data Frame

Description

Convert Array to Data Frame

Usage

arrayToDataFrame(x, name = deparse(substitute(x)))

Arguments

x

an array

name

name to be given to the value column

Value

data frame with as many rows as there are elements in the input array x. The data frame has one column per dimension of x containing the dimension names and one additional column called according to name containing the array values.

Examples

x <- array(1:24, dim = c(2, 3, 4), dimnames = list(
  c("a", "b"), 
  c("x", "y", "z"), 
  c("r", "s", "t", "u")
))

arrayToDataFrame(x)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.