Prints a venn-diagram style summary of the unique value overlap between two columns and also invisibly returns a dataframe that can be assigned to a variable and queried with the overlap helpers. The helpers can return values that appeared only the first col, second col, or both cols.

confirm_overlap(vec1, vec2, return_tibble = F)

co_find_only_in_1(co_output)

co_find_only_in_2(co_output)

co_find_in_both(co_output)

Arguments

vec1

vector 1

vec2

vector 2

return_tibble

logical. If TRUE, returns a tibble. otherwise by default returns the database invisibly to be queried by helper functions.

co_output

dataframe output from confirm_overlap

Value

tibble. overlap summary or overlap table

Examples


confirm_overlap(iris$Sepal.Width, iris$Sepal.Length) -> iris_overlap
#> # A tibble: 1 × 5
#>   only_in_iris_Sepal.Width only_in_iris_Sep… shared_names total_names pct_shared
#>                      <int>             <int>        <int>       <int> <chr>     
#> 1                       22                34            1          57 2%        

iris_overlap
#> # A tibble: 57 × 4
#>        x iris_Sepal.Width iris_Sepal.Length both_flags
#>    <dbl>            <dbl>             <dbl>      <dbl>
#>  1   3.5                1                 0          1
#>  2   3                  1                 0          1
#>  3   3.2                1                 0          1
#>  4   3.1                1                 0          1
#>  5   3.6                1                 0          1
#>  6   3.9                1                 0          1
#>  7   3.4                1                 0          1
#>  8   2.9                1                 0          1
#>  9   3.7                1                 0          1
#> 10   4                  1                 0          1
#> # … with 47 more rows

iris_overlap %>%
co_find_only_in_1()
#> # A tibble: 22 × 1
#>    iris_Sepal.Width
#>               <dbl>
#>  1              3.5
#>  2              3  
#>  3              3.2
#>  4              3.1
#>  5              3.6
#>  6              3.9
#>  7              3.4
#>  8              2.9
#>  9              3.7
#> 10              4  
#> # … with 12 more rows

iris_overlap %>%
co_find_only_in_2()
#> # A tibble: 34 × 1
#>    iris_Sepal.Length
#>                <dbl>
#>  1               5.1
#>  2               4.9
#>  3               4.7
#>  4               4.6
#>  5               5  
#>  6               5.4
#>  7               4.8
#>  8               4.3
#>  9               5.8
#> 10               5.7
#> # … with 24 more rows

iris_overlap %>%
co_find_in_both()
#> # A tibble: 1 × 1
#>       x
#>   <dbl>
#> 1   4.4