blob: 1591f5d56b0190be771771c37739e3a656061c46 [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,
26 file_type = if (is_latex()) "png" else "svg",
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.
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
47\item{lim, xlim, ylim}{Manually specify plotting range in the form of
48\code{c(0, 10)}. \code{lim} is used in \code{spec_hist} and \code{spec_boxplot}; \code{xlim}
49and \code{ylim} are used in \code{spec_line}.}
50
51\item{xaxt}{On/Off for xaxis text}
52
53\item{yaxt}{On/Off for yaxis text}
54
55\item{ann}{On/Off for annotations (titles and axis titles)}
56
57\item{col}{Color for the fill of the histogram bar/boxplot box.}
58
59\item{border}{Color for the border.}
60
61\item{boxlty}{Boxplot - box boarder type}
62
63\item{medcol}{Boxplot - median line color}
64
65\item{medlwd}{Boxplot - median line width}
66
67\item{dir}{Directory of where the images will be saved.}
68
69\item{file}{File name. If not provided, a random name will be used}
70
71\item{file_type}{Graphic device. Support \code{png} or \code{svg}. SVG is recommended
72for HTML output}
73
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,
79boxplot, and line. You can use them together with \code{column_spec} to
80generate inline plot in tables. By default, this function will save images
81in a folder called "kableExtra" and return the address of the file.
82}