table.n {bioimagetools} | R Documentation |
Cross Tabulation and Table Creation (including empty classes)
table.n( x, m = max(x, na.rm = TRUE), percentage = FALSE, weight = NULL, parallel = FALSE )
x |
R object with classes |
m |
maximum number of classes |
percentage |
boolean. If TRUE result is in percentages. |
weight |
weight for each voxel |
parallel |
Logical. Can we use parallel computing? |
vector with (weighted) counts (including empty classes)
Volker Schmid 2013-2016
x <- c(1,1,2,2,4,4,4) table.n(x) # [1] 2 2 0 3 table.n(x, m=5) # [1] 2 2 0 3 0 table.n(x, weight=c(1,1,1,2,.5,.5,.5)) # [1] 2.0 3.0 0.0 1.5