[R] array to data.frame

Spencer Graves spencer.graves at pdf.com
Sat Apr 26 16:38:31 CEST 2003

Dear Peter:

Does the following not work in certain situations:

A <- array(1:4, dim=c(2,2))
dimnames(A) <- list(NULL, c("a", "b"))

Or is it deprecated for other reasons?

Spencer Graves

Peter Dalgaard BSA wrote:
> Jorge Magalhães <jmagalhaes at oninetspeed.pt> writes:
>>How i can convert a array in to data.frame structure?
>>For example,
>>dim=c(2,4,6), dimnames=list(grupo=c("I","II"), 
> as.data.frame(as.table(vinteesete))
> (or as.data.frame.table(vinteesete), but with S4 methods coming in it
> is increasingly considered bad style to apply methods to objects that
> are not of the requisite class.)

More information about the R-help mailing list