pool: Pool 'incidence' across groups

Description Usage Arguments Author(s) See Also Examples

View source: R/pool.R

Description

This function pools incidence across all groups of an incidence object. The resulting incidence() object will contains counts summed over all groups present in the input.

Usage

1
pool(x)

Arguments

x

An 'incidence' object.

Author(s)

Thibaut Jombart thibautjombart@gmail.com

See Also

The incidence() function to generate the 'incidence' objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dat <- as.integer(c(0,1,2,2,3,5,7))
group <- factor(c(1, 2, 3, 3, 3, 3, 1))
i <- incidence(dat, groups = group)
i
i$counts

## pool all groups
pool(i)
pool(i)$counts

## pool only groups 1 and 3
pool(i[,c(1,3)])
pool(i[,c(1,3)])$counts

incidence documentation built on Nov. 8, 2020, 4:30 p.m.