Make a simple boxplot plotting tbl

boxplot_tbl(x, index = 2)

Arguments

x

a matrix or data.frame

index

summarisation index, "1" for rows or "2" (default) for columns.

Value

A tibble

Examples

data(cpop_data_binary, package = 'CPOP')
## Loading example matrix
x1 = cpop_data_binary$x1
set.seed(1)
boxplot_tbl(x = x1, index = 1)
#> # A tibble: 100 × 6
#>    object means medians      q1    q3  n_na
#>    <fct>  <dbl>   <dbl>   <dbl> <dbl> <int>
#>  1 001    0.959   0.897  0.332   1.64     0
#>  2 002    0.724   0.725  0.0824  1.47     0
#>  3 003    1.14    1.15   0.747   1.69     0
#>  4 004    0.953   0.882  0.171   1.35     0
#>  5 005    0.908   0.761 -0.0496  1.61     0
#>  6 006    1.15    1.21   0.538   1.54     0
#>  7 007    0.671   0.644 -0.0426  1.44     0
#>  8 008    1.30    1.38   0.455   2.05     0
#>  9 009    0.772   0.800  0.146   1.22     0
#> 10 010    0.902   0.848  0.162   1.46     0
#> # … with 90 more rows
boxplot_tbl(x = x1, index = 2)
#> # A tibble: 20 × 6
#>    object means medians     q1    q3  n_na
#>    <fct>  <dbl>   <dbl>  <dbl> <dbl> <int>
#>  1 X01    0.938   0.921 0.244   1.56     0
#>  2 X02    1.03    0.999 0.248   1.73     0
#>  3 X03    0.817   0.807 0.0848  1.50     0
#>  4 X04    1.20    1.19  0.515   1.93     0
#>  5 X05    1.03    1.11  0.423   1.64     0
#>  6 X06    0.978   1.00  0.303   1.66     0
#>  7 X07    0.965   0.985 0.318   1.76     0
#>  8 X08    1.01    0.880 0.340   1.71     0
#>  9 X09    1.10    1.03  0.481   1.78     0
#> 10 X10    0.897   0.784 0.303   1.40     0
#> 11 X11    1.09    0.995 0.411   1.85     0
#> 12 X12    1.04    0.925 0.385   1.71     0
#> 13 X13    0.980   0.975 0.259   1.69     0
#> 14 X14    0.959   0.978 0.175   1.60     0
#> 15 X15    1.01    1.00  0.505   1.56     0
#> 16 X16    1.03    1.08  0.405   1.62     0
#> 17 X17    0.920   0.922 0.196   1.61     0
#> 18 X18    1.02    0.912 0.428   1.72     0
#> 19 X19    0.890   0.996 0.246   1.42     0
#> 20 X20    1.07    0.948 0.510   1.77     0