Show a boxplot using characters in the terminal window

term_boxplot(formula, data = NULL, width = getOption("width"))

Arguments

formula

a formula

data

data frame or matrix

width

width of the boxplot in characters

Value

invisibly return the color summary data frame used to draw the boxplot

Examples

term_boxplot(mpg ~ cyl, data=mtcars)
#> # Color data frame (class colorDF) 5 x 4:
#>  │Col  │Class│NAs  │unique│Summary                                          
#><chr><chr><int><int> <chr>                                            
#> 14    <dbl>│    0│     9│                      ╾──┤      +        ├──────╼
#> 26    <dbl>│    0│     6│               ╾─┤ +  ├                          
#> 38    <dbl>│    0│    12│╾───────┤ + ├─────╼                              
#> 4Range<chr>│    0│     1│Only one value: Range: 10.4 - 33.9               
term_boxplot(Sepal.Length ~ Species, data=iris, width=70)
#> # Color data frame (class colorDF) 5 x 4:
#>  │Col       │Class│NAs  │unique│Summary                           
#><chr>     <chr><int><int> <chr>                             
#> 1setosa    <dbl>│    0│    15│╾────┤+ ├─────╼                   
#> 2versicolor<dbl>│    0│    21│      ╾─────┤  +  ├──────╼        
#> 3virginica <dbl>│    0│    21│      ╾───────────┤ +   ├────────╼
#> 4Range     <chr>│    0│     1│Only one value: Range: 4.3 - 7.9