Hao Zhu | f6b60e8 | 2020-10-21 18:58:19 -0400 | [diff] [blame] | 1 | % 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{ |
| 7 | spec_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", |
| 21 | cex = 0.3, |
| 22 | frame.plot = FALSE, |
| 23 | dir = if (is_latex()) rmd_files_dir() else tempdir(), |
| 24 | file = NULL, |
Hao Zhu | 30db027 | 2021-02-19 13:02:29 -0500 | [diff] [blame^] | 25 | file_type = if (is_latex()) "pdf" else svglite::svglite, |
Hao Zhu | f6b60e8 | 2020-10-21 18:58:19 -0400 | [diff] [blame] | 26 | ... |
| 27 | ) |
| 28 | } |
| 29 | \arguments{ |
| 30 | \item{x, xmin, xmax}{A scalar value or List of scalar values for dot, left |
| 31 | and right errorbar.} |
| 32 | |
| 33 | \item{vline}{A scalar value for where to draw a vertical line.} |
| 34 | |
| 35 | \item{width}{The width of the plot in pixel} |
| 36 | |
| 37 | \item{height}{The height of the plot in pixel} |
| 38 | |
| 39 | \item{res}{The resolution of the plot. Default is 300.} |
| 40 | |
| 41 | \item{same_lim}{T/F. If x is a list of vectors, should all the plots be |
| 42 | plotted in the same range? Default is True.} |
| 43 | |
| 44 | \item{lim}{Manually specify plotting range in the form of |
| 45 | \code{c(0, 10)}.} |
| 46 | |
| 47 | \item{xaxt}{On/Off for xaxis text} |
| 48 | |
| 49 | \item{yaxt}{On/Off for yaxis text} |
| 50 | |
| 51 | \item{ann}{On/Off for annotations (titles and axis titles)} |
| 52 | |
| 53 | \item{col}{Color for the fill of the histogram bar/boxplot box.} |
| 54 | |
| 55 | \item{cex}{size of the mean dot and error bar size.} |
| 56 | |
| 57 | \item{frame.plot}{T/F for whether to plot the plot frames.} |
| 58 | |
| 59 | \item{dir}{Directory of where the images will be saved.} |
| 60 | |
| 61 | \item{file}{File name. If not provided, a random name will be used} |
| 62 | |
| 63 | \item{file_type}{Graphic device. Can be character (e.g., \code{"pdf"}) |
| 64 | or a graphics device function (\code{grDevices::pdf}). This defaults |
| 65 | to \code{"pdf"} if the rendering is in LaTeX and \code{"svg"} otherwise. |
| 66 | for HTML output} |
| 67 | |
| 68 | \item{...}{extra parameters sending to \code{hist()}} |
| 69 | } |
| 70 | \description{ |
| 71 | These functions helps you quickly generate sets of sparkline |
| 72 | style plots using base R plotting system. Currently, we support histogram, |
| 73 | boxplot, line, scatter and pointrange plots. You can use them together with |
| 74 | \code{column_spec} to generate inline plot in tables. By default, this function |
| 75 | will save images in a folder called "kableExtra" and return the address of |
| 76 | the file. |
| 77 | } |