Addition of two 1-D base::table objects
table_add_1d(t1, t2, keep_zeros = FALSE)
Arguments
- t1
a base::table object
- t2
a second base::table object
- keep_zeros
whether we should retain in the result values with total count 0 (possible if
negating one of the added tables).
Value
a base::table where the count of every label is the sum of the counts in t1 and t2
Examples
table_add_1d(table(1:10), table(5:15))
#> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#> 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1