?tabulate

> x<-c(1,1,1,2,2,2,5,5,5)
> tabulate(x)
[1] 3 3 0 0 3
>

On Mon, Oct 31, 2011 at 8:35 AM, Leonardo Bergamini
<llbergam...@gmail.com> wrote:
> I need a table showing even the zero counts.
>
> x<-c(1,1,1,2,2,2,5,5,5)
> table(x)
> x
> 1 2 5
> 3 3 3
>
>
> How can I get this:
>
> x
> 1 2 3 4 5
> 3 3 0 0 3
>
> Thanks,
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to