[R] Reshaping a table

S Ellison S.Ellison at LGCGroup.com
Thu Apr 11 18:11:55 CEST 2013


> -----Original Message-----
> Here's the relevant portion of the as.table Help file:

But ... is an argument to table(), not to as.table; this part of the help file is not referring to as.table.

The first argument to as.table is x, which is an 'arbitrary R object'. as.table is a generic; it depends on the existence of a method for the object in question.

On looking at the code, as.table.default does not include handling for a data frame; only for tables and for things that are either arrays or numeric. Data frames are none of those things, so as.table says it can;t handle them.

The help file doesn't say what as.table doesn't do, perhaps because the list would be quite long. It would have headed off this post, though, if it mentioned that the default method accepted only a table, array, or numeric.

S Ellison

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list