Skip to content

How to apply table() on subdata and stack outputs

3 messages · Sean Zhang, Uwe Ligges, jim holtman

#
Sean Zhang wrote:
I'd simply use

   table(input.df)

or perhaps closer to the result you want:

  reshape(as.data.frame(table(input.df)), direction="wide",
          timevar="var_interest")


Uwe Ligges
#
This may be what you want:
happy soso unhappy
  jack 0     2    1       1
  tom  1     1    0       1
On Wed, Feb 11, 2009 at 1:34 PM, Sean Zhang <seanecon at gmail.com> wrote: