It seems to me that a combination of ftable and xtabs works fine:
> prob1<- data.frame(victim=c(rep('white',4),rep('black',4)),
+ perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)),
+ death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97))
> prob1
victim perp death count
1
On Tue, Apr 22, 2008 at 8:24 AM, hadley wickham <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 21, 2008 at 9:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote:
> > How does one ideally handle and display multidimenstional contingency
> > tables in R v. 2.6.2?
> >
> > E.g.:
> >
> > > prob1<- da
On Mon, Apr 21, 2008 at 9:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote:
> How does one ideally handle and display multidimenstional contingency
> tables in R v. 2.6.2?
>
> E.g.:
>
> > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)),
> + perp=c(rep('white',2),rep('black',2),r
Now that is simple and elegant. Thanks!
PS. Is there a course available for learning how to read R help information? :)
At 10:52 PM 4/21/2008, Gabor Grothendieck wrote:
> xtabs(count ~., prob1)
>
>On Mon, Apr 21, 2008 at 10:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote:
> > How does one ide
xtabs(count ~., prob1)
On Mon, Apr 21, 2008 at 10:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote:
> How does one ideally handle and display multidimenstional contingency
> tables in R v. 2.6.2?
>
> E.g.:
>
> > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)),
> + perp=c(rep('whit
How does one ideally handle and display multidimenstional contingency
tables in R v. 2.6.2?
E.g.:
> prob1<- data.frame(victim=c(rep('white',4),rep('black',4)),
+ perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)),
+ death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97)
6 matches
Mail list logo