added spec_image, spec_hist, spec_boxplot and fixed some cran comments
diff --git a/man/column_spec.Rd b/man/column_spec.Rd
index aeff8ec..8d19fc7 100644
--- a/man/column_spec.Rd
+++ b/man/column_spec.Rd
@@ -26,7 +26,8 @@
link = NULL,
new_tab = TRUE,
tooltip = NULL,
- popover = NULL
+ popover = NULL,
+ image = NULL
)
}
\arguments{
@@ -99,6 +100,8 @@
to build a popover is through \code{spec_popover()}. If you only provide a text
string, it will be used as content. Note that You have to enable this
bootstrap module manually. Read the package vignette to see how.}
+
+\item{image}{Vector of image paths.}
}
\description{
This function allows users to select a column and then specify
diff --git a/man/kable_classic.Rd b/man/kable_classic.Rd
index 7192342..1883eb9 100644
--- a/man/kable_classic.Rd
+++ b/man/kable_classic.Rd
@@ -26,7 +26,7 @@
kable_minimal(
kable_input,
lightable_options = "basic",
- html_font = "\\"Trebuchet MS\\", verdana, calibri, sans-serif",
+ html_font = "\\"Trebuchet MS\\", verdana, sans-serif",
...
)
diff --git a/man/spec_hist.Rd b/man/spec_hist.Rd
new file mode 100644
index 0000000..9deb046
--- /dev/null
+++ b/man/spec_hist.Rd
@@ -0,0 +1,119 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/mini_plots.R
+\name{spec_hist}
+\alias{spec_hist}
+\alias{spec_boxplot}
+\title{Helper functions to generate inline sparklines}
+\usage{
+spec_hist(
+ x,
+ width = 200,
+ height = 50,
+ res = 300,
+ breaks = "Sturges",
+ same_lim = TRUE,
+ lim = NULL,
+ xaxt = "n",
+ yaxt = "n",
+ ann = FALSE,
+ col = "lightgray",
+ border = NULL,
+ dir = if (is_latex()) rmd_files_dir() else tempdir(),
+ file = NULL,
+ file_type = if (is_latex()) "png" else "svg",
+ ...
+)
+
+spec_boxplot(
+ x,
+ width = 200,
+ height = 50,
+ res = 300,
+ add_label = FALSE,
+ label_digits = 2,
+ same_lim = TRUE,
+ lim = NULL,
+ xaxt = "n",
+ yaxt = "n",
+ ann = FALSE,
+ col = "lightgray",
+ border = NULL,
+ boxlty = 0,
+ medcol = "red",
+ medlwd = 1,
+ dir = if (is_latex()) rmd_files_dir() else tempdir(),
+ file = NULL,
+ file_type = if (is_latex()) "png" else "svg",
+ ...
+)
+}
+\arguments{
+\item{x}{Vector of values or List of vectors of values.}
+
+\item{width}{The width of the plot in pixel}
+
+\item{height}{The height of the plot in pixel}
+
+\item{res}{The resolution of the plot. Default is 300.}
+
+\item{breaks}{one of:
+ \itemize{
+ \item a vector giving the breakpoints between histogram cells,
+ \item a function to compute the vector of breakpoints,
+ \item a single number giving the number of cells for the histogram,
+ \item a character string naming an algorithm to compute the
+ number of cells (see \sQuote{Details}),
+ \item a function to compute the number of cells.
+ }
+ In the last three cases the number is a suggestion only; as the
+ breakpoints will be set to \code{\link{pretty}} values, the number
+ is limited to \code{1e6} (with a warning if it was larger). If
+ \code{breaks} is a function, the \code{x} vector is supplied to it
+ as the only argument (and the number of breaks is only limited by
+ the amount of available memory).
+ }
+
+\item{same_lim}{T/F. If x is a list of vectors, should all the plots be
+plotted in the same range? Default is True.}
+
+\item{lim}{Manually specify plotting range in the form of \code{c(0, 10)}.}
+
+\item{xaxt}{On/Off for xaxis text}
+
+\item{yaxt}{On/Off for yaxis text}
+
+\item{ann}{On/Off for annotations (titles and axis titles)}
+
+\item{col}{Color for the fill of the histogram bar/boxplot box.}
+
+\item{border}{Color for the border.}
+
+\item{dir}{Directory of where the images will be saved.}
+
+\item{file}{File name. If not provided, a random name will be used}
+
+\item{file_type}{Graphic device. Support \code{png} or \code{svg}. SVG is recommended
+for HTML output}
+
+\item{...}{further arguments and \link[graphics]{graphical parameters} passed to
+ \code{\link[graphics]{plot.histogram}} and thence to \code{\link[graphics]{title}} and
+ \code{\link[graphics]{axis}} (if \code{plot = TRUE}).}
+
+\item{add_label}{For boxplot. T/F to add labels for min, mean and max.}
+
+\item{label_digits}{If T for add_label, rounding digits for the label.
+Default is 2.}
+
+\item{boxlty}{Boxplot - box boarder type}
+
+\item{medcol}{Boxplot - median line color}
+
+\item{medlwd}{Boxplot - median line width}
+}
+\description{
+These functions helps you quickly generate sets of sparkline
+style plots using base R plotting system. Currently, we support histogram
+and boxplot. You can use them together with \code{column_spec} to
+generate inline plot in tables. By default, this function will save images
+in a folder called "kableExtra" and return the address of the file.
+}
diff --git a/man/spec_image.Rd b/man/spec_image.Rd
new file mode 100644
index 0000000..a4638e5
--- /dev/null
+++ b/man/spec_image.Rd
@@ -0,0 +1,24 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/spec_tools.R
+\name{spec_image}
+\alias{spec_image}
+\title{Setup image path, size, etc}
+\usage{
+spec_image(path, width, height, res = 300, svg_text = NULL)
+}
+\arguments{
+\item{path}{file path(s)}
+
+\item{width}{image width in pixel}
+
+\item{height}{image height in pixel}
+
+\item{res}{image resolution.}
+
+\item{svg_text}{If you have the raw text for SVG. Put them here}
+}
+\description{
+Users can directly provide image file path to column spec.
+However, if you need to specify the size of the image, you will need this
+function.
+}