Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/mini_plots.R |
| 3 | \name{spec_boxplot} |
| 4 | \alias{spec_boxplot} |
| 5 | \title{Helper functions to generate inline sparklines} |
| 6 | \usage{ |
| 7 | spec_boxplot( |
| 8 | x, |
| 9 | width = 200, |
| 10 | height = 50, |
| 11 | res = 300, |
| 12 | add_label = FALSE, |
| 13 | label_digits = 2, |
| 14 | same_lim = TRUE, |
| 15 | lim = NULL, |
| 16 | xaxt = "n", |
| 17 | yaxt = "n", |
| 18 | ann = FALSE, |
| 19 | col = "lightgray", |
| 20 | border = NULL, |
| 21 | boxlty = 0, |
| 22 | medcol = "red", |
| 23 | medlwd = 1, |
| 24 | dir = if (is_latex()) rmd_files_dir() else tempdir(), |
| 25 | file = NULL, |
Bill Evans | 95a0428 | 2020-09-14 12:39:25 -0700 | [diff] [blame] | 26 | file_type = if (is_latex()) "pdf" else "svg", |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame] | 27 | ... |
| 28 | ) |
| 29 | } |
| 30 | \arguments{ |
| 31 | \item{x}{Vector of values or List of vectors of values.} |
| 32 | |
| 33 | \item{width}{The width of the plot in pixel} |
| 34 | |
| 35 | \item{height}{The height of the plot in pixel} |
| 36 | |
| 37 | \item{res}{The resolution of the plot. Default is 300.} |
| 38 | |
| 39 | \item{add_label}{For boxplot. T/F to add labels for min, mean and max.} |
| 40 | |
| 41 | \item{label_digits}{If T for add_label, rounding digits for the label. |
| 42 | Default is 2.} |
| 43 | |
| 44 | \item{same_lim}{T/F. If x is a list of vectors, should all the plots be |
| 45 | plotted in the same range? Default is True.} |
| 46 | |
Hao Zhu | f6b60e8 | 2020-10-21 18:58:19 -0400 | [diff] [blame] | 47 | \item{lim}{Manually specify plotting range in the form of |
| 48 | \code{c(0, 10)}.} |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame] | 49 | |
| 50 | \item{xaxt}{On/Off for xaxis text} |
| 51 | |
| 52 | \item{yaxt}{On/Off for yaxis text} |
| 53 | |
| 54 | \item{ann}{On/Off for annotations (titles and axis titles)} |
| 55 | |
| 56 | \item{col}{Color for the fill of the histogram bar/boxplot box.} |
| 57 | |
| 58 | \item{border}{Color for the border.} |
| 59 | |
| 60 | \item{boxlty}{Boxplot - box boarder type} |
| 61 | |
| 62 | \item{medcol}{Boxplot - median line color} |
| 63 | |
| 64 | \item{medlwd}{Boxplot - median line width} |
| 65 | |
| 66 | \item{dir}{Directory of where the images will be saved.} |
| 67 | |
| 68 | \item{file}{File name. If not provided, a random name will be used} |
| 69 | |
Bill Evans | 95a0428 | 2020-09-14 12:39:25 -0700 | [diff] [blame] | 70 | \item{file_type}{Graphic device. Can be character (e.g., \code{"pdf"}) |
| 71 | or a graphics device function (\code{grDevices::pdf}). This defaults |
| 72 | to \code{"pdf"} if the rendering is in LaTeX and \code{"svg"} otherwise.} |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame] | 73 | |
| 74 | \item{...}{extraparameters passing to boxplot} |
| 75 | } |
| 76 | \description{ |
| 77 | These functions helps you quickly generate sets of sparkline |
| 78 | style plots using base R plotting system. Currently, we support histogram, |
Hao Zhu | f6b60e8 | 2020-10-21 18:58:19 -0400 | [diff] [blame] | 79 | boxplot, line, scatter and pointrange plots. You can use them together with |
| 80 | \code{column_spec} to generate inline plot in tables. By default, this function |
| 81 | will save images in a folder called "kableExtra" and return the address of |
| 82 | the file. |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame] | 83 | } |