blob: 7b11fdde79dd87ede90a48087651a60df3707b3b [file] [log] [blame]
Kirill Müller3769e2e2022-05-26 20:07:52 +02001% 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{
7spec_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
33plotted 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"})
53or a graphics device function (\code{grDevices::pdf}). This defaults
54to \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.
65Default 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{
74These functions helps you quickly generate sets of sparkline
75style plots using base R plotting system. Currently, we support histogram,
76boxplot, 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
78will save images in a folder called "kableExtra" and return the address of
79the file.
80}