Skip to content
Back to formatted view

Raw Message

Message-ID: <-1923503594985485913@unknownmsgid>
Date: 2011-10-21T20:15:32Z
From: Luk Arbuckle
Subject: Converting data frame into multidimensional array

Consider the following data frame

X <- data.frame(Titanic)

Does anyone know of an easy way to convert X into a multidimensional
array?  Example that doesn't work

X <- as.array(X, dim=c(4,2,2,2))

To do what I need, X needs to be converted into an array of dimensions
c(4,2,2,2) in this case, not a table.

Thanks in advance.