Re: [R] Cross-tabulation Question

2008-09-29 Thread Gabor Grothendieck
Try this: > with(unique(x), table(V2, V3)) V3 V2Apple Cake One 21 On Mon, Sep 29, 2008 at 4:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > This is a cross tabulation question. Suppose that, > > > >> d=read.table("clipboard",header=F) > > > >> d > >

Re: [R] Cross-tabulation Question

2008-09-29 Thread John Kane
?aggregate or have a look at the reshape package. --- On Mon, 9/29/08, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > From: Shubha Vishwanath Karanth <[EMAIL PROTECTED]> > Subject: [R] Cross-tabulation Question > To: [EMAIL PROTECTED] > Received: Monday, Septembe

Re: [R] Cross-tabulation Question

2008-09-29 Thread jim holtman
> x V1 V2V3 1 A One Apple 2 A One Cake 3 A One Cake 4 B One Apple 5 B One Apple 6 B One Apple > tapply(x$V1, list(x$V2, x$V3), function(z) length(unique(z))) Apple Cake One 21 > On Mon, Sep 29, 2008 at 4:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R

[R] Cross-tabulation Question

2008-09-29 Thread Shubha Vishwanath Karanth
Hi R, This is a cross tabulation question. Suppose that, > d=read.table("clipboard",header=F) > d V1 V2V3 A One Apple A One Cake A One Cake B One Apple B One Apple B One Apple > table(d$V2,d$V3) Apple Cake One 42 Bu