Utility function to calculate intersection and setdiffs for two vectors

textvenn(A, B, quiet = FALSE)

Arguments

A

a vector

B

a vector of the same type as A

quiet

suppress printing if TRUE

Value

a list with three elements: A is setdiff(A,B). int is intersect(A,B). B is setdiff(B,A)

Details

Originally from randomFunctions

Examples

A <- 1:3 B <- 2:4 textvenn(A,B)
#> set A: #> 1 #> intersection: #> 2 3 #> set B: #> 4
tv <- textvenn(A,B,quiet=TRUE) tv
#> $A #> [1] 1 #> #> $int #> [1] 2 3 #> #> $B #> [1] 4 #>