> -Original Message-
> This would do it in your example:
>
> > levels(animals$V1) <- c("cat","tiger","dog","fish")
> > table(animals)
>
> cattigerdog fish
> 2 200
But be very wary of
levels(animals$V2)<- c("cat","tiger","dog","fish")
table(animals
> I would like to get the frequency
> (counts) of all the variables in a single column (that is
> easy), but I would also like to return the value 0 for the
> absence of variables defined in another column.
If you use factor() on your columns and include all the animals in the factor
levels, yo
This would do it in your example:
> levels(animals$V1) <- c("cat","tiger","dog","fish")
> table(animals)
cattigerdog fish
2 200
HTH
David
cat tiger dog fish
2 2 0 0
On 11 April 2012 14:21, Daniel Gabrieli wrote:
> animals = as.data
On Apr 11, 2012, at 9:21 AM, Daniel Gabrieli wrote:
Hi,
I hope this is not too trivial, but I've had this recurring problem
and I think there is super easy solution, just not sure what it is.
Please see short example below. I would like to get the frequency
(counts) of all the variables in a
Hi,
I hope this is not too trivial, but I've had this recurring problem
and I think there is super easy solution, just not sure what it is.
Please see short example below. I would like to get the frequency
(counts) of all the variables in a single column (that is easy), but I
would also like to r
5 matches
Mail list logo