On Tue, 2008-08-12 at 01:21 -0700, dennis11 wrote:
> I want to create a vecor with frequencies. 
> 
> I have tried this:
> 
> a <- c(1,1,1,1,2,3,4,5,5)
> b <- table(a)
> print (b[1])
> 
> which results in:
> > print (b[1])
> 1 
> 4 
> The only thing I want is the 4.

Isn't this one if the situations where you actually want b[[1]]?

> So this seems obvious:
> print (b[1,2])
> 
> but it does not work:
> Error in b[1, 2] : incorrect number of dimensions
> 
> How do I get a vector or how do I refer to the "4" without getting the "1"
> label as well?
-- 
Michael R. Head <[EMAIL PROTECTED]>
http://www.cs.binghamton.edu/~mike/
______________________________________________
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