common_group find the common elements of selected groups

common_group(dat, group_vec, ref_vec)

Arguments

dat

a dataframe, preferably the wide format

group_vec

grouping vector, contain column names to be examine

ref_vec

reference vector, contain column names of target to be check

Value

a data table with range/elements of each column

Author

Tien-Cheng Wang

Examples

common_group(mtcars,"cyl","gear")
#> Unique gear of 3 groups
#> [1] 3 5
common_group(iris,"Species","Sepal.Length")
#> Unique Sepal.Length of 3 groups
#> [1] 4.9 5.8 5.7