Small functions to summarize the decision table for pre-processing

count_paper_decisions(df, sort = TRUE)

count_paper_pair_decisions(df)

count_variable_type(df, sort = TRUE)

skim_variable_binary(df)

Arguments

df

The decision table object.

sort

A logical indicating whether to sort results by count in descending order.Default to `TRUE`

Value

A data frame containing papers and their decision counts.

Examples

raw_df <- read.csv(system.file("papers.csv", package = "dossier")) |> tibble::as_tibble()
df <- as_decision_tbl(raw_df)
count_paper_decisions(df)
#>         paper .n
#> 1       braga 16
#> 2       ostro 12
#> 3 katsouyanni 10
#> 4    schwartz 10
#> 5   zanobetti 10
#> 6        peel  6
count_variable_type(df)
#> # A tibble: 11 × 3
#>    variable            type         .n
#>    <chr>               <chr>     <int>
#>  1 temperature         parameter     6
#>  2 time                parameter     6
#>  3 humidity            parameter     4
#>  4 temperature         temporal      4
#>  5 PM                  temporal      3
#>  6 humidity            temporal      3
#>  7 time                spatial       2
#>  8 barometric_pressure parameter     1
#>  9 barometric_pressure spatial       1
#> 10 humidity            spatial       1
#> 11 temperature         spatial       1
df |> filter_var_type(n = 6) |> count_paper_pair_decisions()
#> # A data frame: 15 × 3
#>    paper1      paper2         .n
#>    <chr>       <chr>       <int>
#>  1 braga       katsouyanni     6
#>  2 braga       ostro           4
#>  3 braga       peel            2
#>  4 braga       schwartz        4
#>  5 braga       zanobetti       6
#>  6 katsouyanni ostro           6
#>  7 katsouyanni peel            3
#>  8 katsouyanni schwartz        4
#>  9 katsouyanni zanobetti       8
#> 10 ostro       peel            6
#> 11 ostro       schwartz        7
#> 12 ostro       zanobetti       6
#> 13 peel        schwartz        5
#> 14 peel        zanobetti       3
#> 15 schwartz    zanobetti       4