blob: ae97578d2e4055a5bc0624348ee15249398c09ff [file] [log] [blame]
Hao Zhu5fe235c2020-08-26 00:26:49 -04001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/mini_plots.R
3\name{spec_hist}
4\alias{spec_hist}
Hao Zhu5fe235c2020-08-26 00:26:49 -04005\title{Helper functions to generate inline sparklines}
6\usage{
7spec_hist(
8 x,
9 width = 200,
10 height = 50,
11 res = 300,
12 breaks = "Sturges",
13 same_lim = TRUE,
14 lim = NULL,
15 xaxt = "n",
16 yaxt = "n",
17 ann = FALSE,
18 col = "lightgray",
19 border = NULL,
20 dir = if (is_latex()) rmd_files_dir() else tempdir(),
21 file = NULL,
22 file_type = if (is_latex()) "png" else "svg",
23 ...
24)
Hao Zhu5fe235c2020-08-26 00:26:49 -040025}
26\arguments{
27\item{x}{Vector of values or List of vectors of values.}
28
29\item{width}{The width of the plot in pixel}
30
31\item{height}{The height of the plot in pixel}
32
33\item{res}{The resolution of the plot. Default is 300.}
34
Hao Zhu5fe235c2020-08-26 00:26:49 -040035\item{same_lim}{T/F. If x is a list of vectors, should all the plots be
36plotted in the same range? Default is True.}
37
Hao Zhudefd1892020-09-09 00:08:09 -040038\item{lim}{Manually specify plotting range in the form of
39\code{c(0, 10)}.}
Hao Zhu5fe235c2020-08-26 00:26:49 -040040
41\item{xaxt}{On/Off for xaxis text}
42
43\item{yaxt}{On/Off for yaxis text}
44
45\item{ann}{On/Off for annotations (titles and axis titles)}
46
47\item{col}{Color for the fill of the histogram bar/boxplot box.}
48
49\item{border}{Color for the border.}
50
51\item{dir}{Directory of where the images will be saved.}
52
53\item{file}{File name. If not provided, a random name will be used}
54
55\item{file_type}{Graphic device. Support \code{png} or \code{svg}. SVG is recommended
56for HTML output}
57
Hao Zhudefd1892020-09-09 00:08:09 -040058\item{...}{extra parameters sending to \code{hist()}}
Hao Zhu5fe235c2020-08-26 00:26:49 -040059}
60\description{
61These functions helps you quickly generate sets of sparkline
Bill Evans5a383e52020-08-30 20:09:52 -070062style plots using base R plotting system. Currently, we support histogram,
Bill Evanscebc9712020-08-30 19:55:24 -070063boxplot, and line. You can use them together with \code{column_spec} to
Hao Zhu5fe235c2020-08-26 00:26:49 -040064generate inline plot in tables. By default, this function will save images
65in a folder called "kableExtra" and return the address of the file.
66}