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