Skip to contents

Get concordant and discordant pairs for two variables

Usage

get_concordant_discordant_pairs(data, x, y)

Arguments

data

= data

x

variable 1

y

variable 2

Value

a data frame

Examples

mtcars$id <- seq.int(nrow(mtcars))
get_concordant_discordant_pairs(mtcars, x = vs, y = am)
#> # A tibble: 4 × 3
#>   pairs     n type                       
#>   <chr> <int> <chr>                      
#> 1 a         7 concordant: vs = 1 & am = 1
#> 2 b         7 discordant: vs = 1 & am = 0
#> 3 c         6 discordant: vs = 0 & am = 1
#> 4 d        12 concordant: vs = 0 & am = 0