Hao Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 1 | % 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 Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 5 | \title{Helper functions to generate inline sparklines} |
| 6 | \usage{ |
| 7 | spec_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 Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 25 | } |
| 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 Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 35 | \item{same_lim}{T/F. If x is a list of vectors, should all the plots be |
| 36 | plotted in the same range? Default is True.} |
| 37 | |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame^] | 38 | \item{lim}{Manually specify plotting range in the form of |
| 39 | \code{c(0, 10)}.} |
Hao Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 40 | |
| 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 |
| 56 | for HTML output} |
| 57 | |
Hao Zhu | defd189 | 2020-09-09 00:08:09 -0400 | [diff] [blame^] | 58 | \item{...}{extra parameters sending to \code{hist()}} |
Hao Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 59 | } |
| 60 | \description{ |
| 61 | These functions helps you quickly generate sets of sparkline |
Bill Evans | 5a383e5 | 2020-08-30 20:09:52 -0700 | [diff] [blame] | 62 | style plots using base R plotting system. Currently, we support histogram, |
Bill Evans | cebc971 | 2020-08-30 19:55:24 -0700 | [diff] [blame] | 63 | boxplot, and line. You can use them together with \code{column_spec} to |
Hao Zhu | 5fe235c | 2020-08-26 00:26:49 -0400 | [diff] [blame] | 64 | generate inline plot in tables. By default, this function will save images |
| 65 | in a folder called "kableExtra" and return the address of the file. |
| 66 | } |