blob: 9e0f35aa02eb5668bc18702954763a6c36a6f2cf [file] [log] [blame]
Hao Zhuf6b60e82020-10-21 18:58:19 -04001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/mini_plots.R
3\name{spec_pointrange}
4\alias{spec_pointrange}
5\title{Helper functions to generate inline sparklines}
6\usage{
7spec_pointrange(
8 x,
9 xmin,
10 xmax,
11 vline = NULL,
12 width = 200,
13 height = 50,
14 res = 300,
15 same_lim = TRUE,
16 lim = NULL,
17 xaxt = "n",
18 yaxt = "n",
19 ann = FALSE,
20 col = "red",
Hao Zhu78988912021-02-23 11:00:56 -050021 line_col = "black",
Hao Zhuf6b60e82020-10-21 18:58:19 -040022 cex = 0.3,
23 frame.plot = FALSE,
24 dir = if (is_latex()) rmd_files_dir() else tempdir(),
25 file = NULL,
Hao Zhu30db0272021-02-19 13:02:29 -050026 file_type = if (is_latex()) "pdf" else svglite::svglite,
Hao Zhuf6b60e82020-10-21 18:58:19 -040027 ...
28)
29}
30\arguments{
31\item{x, xmin, xmax}{A scalar value or List of scalar values for dot, left
32and right errorbar.}
33
34\item{vline}{A scalar value for where to draw a vertical line.}
35
36\item{width}{The width of the plot in pixel}
37
38\item{height}{The height of the plot in pixel}
39
40\item{res}{The resolution of the plot. Default is 300.}
41
42\item{same_lim}{T/F. If x is a list of vectors, should all the plots be
43plotted in the same range? Default is True.}
44
45\item{lim}{Manually specify plotting range in the form of
46\code{c(0, 10)}.}
47
48\item{xaxt}{On/Off for xaxis text}
49
50\item{yaxt}{On/Off for yaxis text}
51
52\item{ann}{On/Off for annotations (titles and axis titles)}
53
Hao Zhu78988912021-02-23 11:00:56 -050054\item{col}{Color for mean dot.}
55
56\item{line_col}{Color for the line and the error bar.}
Hao Zhuf6b60e82020-10-21 18:58:19 -040057
58\item{cex}{size of the mean dot and error bar size.}
59
60\item{frame.plot}{T/F for whether to plot the plot frames.}
61
62\item{dir}{Directory of where the images will be saved.}
63
64\item{file}{File name. If not provided, a random name will be used}
65
66\item{file_type}{Graphic device. Can be character (e.g., \code{"pdf"})
67or a graphics device function (\code{grDevices::pdf}). This defaults
68to \code{"pdf"} if the rendering is in LaTeX and \code{"svg"} otherwise.
69for HTML output}
70
71\item{...}{extra parameters sending to \code{hist()}}
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 and pointrange 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}