blob: 2c5dab6263ce7148910cf612b79fe366a9a06ec7 [file] [log] [blame]
Hao Zhudefd1892020-09-09 00:08:09 -04001% 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{
7spec_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 Evans95a04282020-09-14 12:39:25 -070026 file_type = if (is_latex()) "pdf" else "svg",
Hao Zhudefd1892020-09-09 00:08:09 -040027 ...
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.
42Default is 2.}
43
44\item{same_lim}{T/F. If x is a list of vectors, should all the plots be
45plotted in the same range? Default is True.}
46
Hao Zhuf6b60e82020-10-21 18:58:19 -040047\item{lim}{Manually specify plotting range in the form of
48\code{c(0, 10)}.}
Hao Zhudefd1892020-09-09 00:08:09 -040049
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 Evans95a04282020-09-14 12:39:25 -070070\item{file_type}{Graphic device. Can be character (e.g., \code{"pdf"})
71or a graphics device function (\code{grDevices::pdf}). This defaults
72to \code{"pdf"} if the rendering is in LaTeX and \code{"svg"} otherwise.}
Hao Zhudefd1892020-09-09 00:08:09 -040073
74\item{...}{extraparameters passing to boxplot}
75}
76\description{
77These functions helps you quickly generate sets of sparkline
78style plots using base R plotting system. Currently, we support histogram,
Hao Zhuf6b60e82020-10-21 18:58:19 -040079boxplot, 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
81will save images in a folder called "kableExtra" and return the address of
82the file.
Hao Zhudefd1892020-09-09 00:08:09 -040083}