Thank-you for the replies. I would say that the function xtabs() is
the simplest method. And thanks for pointing out that a table is also
an array, as I clearly wasn't aware of that.
On 2011-10-21, at 19:07, Gabor Grothendieck wrote:
> On Fri, Oct 21, 2011 at 7:04 PM, Gabor Grothendieck
> wrot
On Fri, Oct 21, 2011 at 7:04 PM, Gabor Grothendieck
wrote:
> On Fri, Oct 21, 2011 at 4:15 PM, Luk Arbuckle wrote:
>> 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
>>
On Fri, Oct 21, 2011 at 4:15 PM, Luk Arbuckle wrote:
> 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
t;
> > -Original Message-
> > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On
> > Behalf Of Luk Arbuckle
> > Sent: Friday, October 21, 2011 3:16 PM
> > To: r-help@r-project.org
> > Subject: [R] Converting data frame into mul
elp-boun...@r-project.org] On
> Behalf Of Luk Arbuckle
> Sent: Friday, October 21, 2011 3:16 PM
> To: r-help@r-project.org
> Subject: [R] Converting data frame into multidimensional array
>
> Consider the following data frame
>
> X <- data.frame(Titanic)
>
> Does anyon
Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Luk Arbuckle
Sent: Friday, October 21, 2011 3:16 PM
To: r-help@r-project.org
Subject: [R] Converting data frame into multidimensional array
Consider the following data frame
X <- data.frame(Ti
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
7 matches
Mail list logo