mat <- matrix(NA, nrow=11, ncol=6)
mat[lower.tri(mat)] <- 1
mat <- cbind(mat, mat[,1:4])
colnames(mat) <- c(paste0("re",1:6), paste0("x",1:4))
mat[6:8,7:10] <- mat[1:3,7:10] # ref
mat[9:11,1:6] <- mat[2:4,1:6]
## accept 1 NA out of 4, 2 NA out of 6 (ie certainly present)
(filt0a <- presenceGrpFilt(mat, rep(1:2, c(6,4)), pres=0.66))
## accept 2 NA out of 4, 2 NA out of 6 (ie min 50% present)
(filt0b <- presenceGrpFilt(mat, rep(1:2, c(6,4)), pres=0.5))
## accept 3 NA out of 4, 4 NA out of 6 (ie possibly present)
(filt0c <- presenceGrpFilt(mat, rep(1:2, c(6,4)), pres=0.19))
Run the code above in your browser using DataLab