[R] convert multi dimensional array to list
R. Michael Weylandt
michael.weylandt at gmail.com
Thu Oct 4 17:25:06 CEST 2012
On Thu, Oct 4, 2012 at 2:54 PM, anto.r <anto.rajaa at gmail.com> wrote:
> I have an 4D named array (the result of recast() on a dataframe) and would
> like to convert it to a list with the names retained.
> I want to convert it to a list so I can access the elements by name like
> to get the corresponding year-name matrix
> This assuming, lists provide an easier way to handle this data. Does it?
I might actually stick with an array, but avoid the dollar sign syntax:
would be one way.
> Also, may be there is a way to get the list I want from my.df without going
> through the melt and cast. Any suggestions are welcome.
> Thanks in advance
> PS: I came across threads for converting list to array but not the other way
> View this message in context: http://r.789695.n4.nabble.com/convert-multi-dimensional-array-to-list-tp4645011.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help