Tue, 21 May 2013 18:57:56 -0700 (PDT)
> To: r-help@r-project.org
> Subject: Re: [R] Something Very Easy
>
> HI,
> I am not sure about what you expect as output.
>
> dat1<- read.table(text="
> Offense Play
> Y A
> N B
> Y A
> Y
HI,
I am not sure about what you expect as output.
dat1<- read.table(text="
Offense Play
Y A
N B
Y A
Y C
N B
N C
",sep="",header=TRUE,stringsAsFactors=FALSE)
with(dat1,tapply(Play,list(Offense),table))
#$N
#
#B C
#2 1
#
#$Y
#
#A C
#2 1
#or
with(dat1
2 matches
Mail list logo