rename spec_line to spec_plot
diff --git a/NAMESPACE b/NAMESPACE
index b8ebdd2..005da73 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -46,7 +46,7 @@
export(spec_font_size)
export(spec_hist)
export(spec_image)
-export(spec_line)
+export(spec_plot)
export(spec_popover)
export(spec_tooltip)
export(text_spec)
diff --git a/R/mini_plots.R b/R/mini_plots.R
index 068cc82..0d264e1 100644
--- a/R/mini_plots.R
+++ b/R/mini_plots.R
@@ -110,7 +110,7 @@
#' plotted in the same range? Default is True.
#' @param lim,xlim,ylim Manually specify plotting range in the form of
#' `c(0, 10)`. `lim` is used in `spec_hist` and `spec_boxplot`; `xlim`
-#' and `ylim` are used in `spec_line`.
+#' and `ylim` are used in `spec_plot`.
#' @param xaxt On/Off for xaxis text
#' @param yaxt On/Off for yaxis text
#' @param ann On/Off for annotations (titles and axis titles)
@@ -239,9 +239,9 @@
#' @param ann On/Off for annotations (titles and axis titles)
#' @param col Color for the fill of the histogram bar/boxplot box.
#' @param border Color for the border.
-#' @param frame.plot On/Off for surrounding box (`spec_line` only). Default
+#' @param frame.plot On/Off for surrounding box (`spec_plot` only). Default
#' is False.
-#' @param lwd Line width for `spec_line`; within `spec_line`, the `minmax`
+#' @param lwd Line width for `spec_plot`; within `spec_plot`, the `minmax`
#' argument defaults to use this value for `cex` for points. Default is 2.
#' @param pch,cex Shape and size for points (if type is other than "l").
#' @param type Passed to `plot`, often one of "l", "p", or "b", see
@@ -254,7 +254,7 @@
#' created instead (and 'type' is ignored). Note that if 'polymin' is in
#' the middle of the 'y' values, it will generate up/down polygons.
#' @param minmax,min,max Arguments passed to `points` to highlight minimum
-#' and maximum values in `spec_line`. If `min` or `max` are `NULL`, they
+#' and maximum values in `spec_plot`. If `min` or `max` are `NULL`, they
#' default to the value of `minmax`. Set to an empty `list()` to disable.
#' @param dir Directory of where the images will be saved.
#' @param file File name. If not provided, a random name will be used
@@ -263,7 +263,7 @@
#' @param ... extra parameters passing to `plot`
#'
#' @export
-spec_line <- function(x, y = NULL, width = 200, height = 50, res = 300,
+spec_plot <- function(x, y = NULL, width = 200, height = 50, res = 300,
same_lim = TRUE, xlim = NULL, ylim = NULL,
xaxt = 'n', yaxt = 'n', ann = FALSE,
col = "lightgray", border = NULL,
@@ -342,7 +342,7 @@
V
}, len1args, names(len1args)))
- return(do.call(Map, c(list(f = spec_line), dots)))
+ return(do.call(Map, c(list(f = spec_plot), dots)))
}
diff --git a/man/spec_boxplot.Rd b/man/spec_boxplot.Rd
index 1591f5d..ebde455 100644
--- a/man/spec_boxplot.Rd
+++ b/man/spec_boxplot.Rd
@@ -46,7 +46,7 @@
\item{lim, xlim, ylim}{Manually specify plotting range in the form of
\code{c(0, 10)}. \code{lim} is used in \code{spec_hist} and \code{spec_boxplot}; \code{xlim}
-and \code{ylim} are used in \code{spec_line}.}
+and \code{ylim} are used in \code{spec_plot}.}
\item{xaxt}{On/Off for xaxis text}
diff --git a/man/spec_line.Rd b/man/spec_plot.Rd
similarity index 83%
rename from man/spec_line.Rd
rename to man/spec_plot.Rd
index fca9b4d..1917de1 100644
--- a/man/spec_line.Rd
+++ b/man/spec_plot.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mini_plots.R
-\name{spec_line}
-\alias{spec_line}
+\name{spec_plot}
+\alias{spec_plot}
\title{Helper functions to generate inline sparklines}
\usage{
-spec_line(
+spec_plot(
x,
y = NULL,
width = 200,
@@ -21,10 +21,10 @@
frame.plot = FALSE,
lwd = 2,
pch = ".",
- cex = 0.1,
+ cex = 2,
type = "l",
polymin = NA,
- minmax = list(pch = ".", cex = lwd, col = "red"),
+ minmax = list(pch = ".", cex = cex, col = "red"),
min = minmax,
max = minmax,
dir = if (is_latex()) rmd_files_dir() else tempdir(),
@@ -58,10 +58,10 @@
\item{border}{Color for the border.}
-\item{frame.plot}{On/Off for surrounding box (\code{spec_line} only). Default
+\item{frame.plot}{On/Off for surrounding box (\code{spec_plot} only). Default
is False.}
-\item{lwd}{Line width for \code{spec_line}; within \code{spec_line}, the \code{minmax}
+\item{lwd}{Line width for \code{spec_plot}; within \code{spec_plot}, the \code{minmax}
argument defaults to use this value for \code{cex} for points. Default is 2.}
\item{pch, cex}{Shape and size for points (if type is other than "l").}
@@ -73,12 +73,12 @@
\item{polymin}{Special argument that converts a "line" to a polygon,
where the flat portion is this value, and the other side of the polygon
is the 'y' value ('x' if no 'y' provided). If 'NA' (the default), then
-this is ignored, otherwise if this is numeric then a polygon is
-created instead (and 'type' is ignored). Note that if 'polymin' is in
-the middle of the 'y' values, it will generate up/down polygons.}
+this is ignored; otherwise if this is numeric then a polygon is
+created (and 'type' is ignored). Note that if 'polymin' is in the middle
+of the 'y' values, it will generate up/down polygons around this value.}
\item{minmax, min, max}{Arguments passed to \code{points} to highlight minimum
-and maximum values in \code{spec_line}. If \code{min} or \code{max} are \code{NULL}, they
+and maximum values in \code{spec_plot}. If \code{min} or \code{max} are \code{NULL}, they
default to the value of \code{minmax}. Set to an empty \code{list()} to disable.}
\item{dir}{Directory of where the images will be saved.}
diff --git a/vignettes/awesome_table_in_html.Rmd b/vignettes/awesome_table_in_html.Rmd
index cb7b1e3..ffafab1 100644
--- a/vignettes/awesome_table_in_html.Rmd
+++ b/vignettes/awesome_table_in_html.Rmd
@@ -235,7 +235,7 @@
c("kableExtra_sm.png", "kableExtra_sm.png"), 50, 50))
```
-`kableExtra` also provides a few inline plotting tools. Right now, there are `spec_hist`, `spec_boxplot`, and `spec_line`. One key feature is that by default, the limits of every subplots are fixed so you can compare across rows. Note that in html, you can also use package `sparkline` to create some jquery based interactive sparklines. Check out the end of this guide for details.
+`kableExtra` also provides a few inline plotting tools. Right now, there are `spec_hist`, `spec_boxplot`, and `spec_plot`. One key feature is that by default, the limits of every subplots are fixed so you can compare across rows. Note that in html, you can also use package `sparkline` to create some jquery based interactive sparklines. Check out the end of this guide for details.
```{r}
mpg_list <- split(mtcars$mpg, mtcars$cyl)
@@ -245,7 +245,7 @@
kable_paper(full_width = F) %>%
column_spec(2, image = spec_boxplot(mpg_list)) %>%
column_spec(3, image = spec_hist(mpg_list)) %>%
- column_spec(4, image = spec_line(mpg_list, same_lim = FALSE))
+ column_spec(4, image = spec_plot(mpg_list, same_lim = FALSE))
```
## Row spec
diff --git a/vignettes/awesome_table_in_pdf.Rmd b/vignettes/awesome_table_in_pdf.Rmd
index 2fd3b25..6976746 100644
--- a/vignettes/awesome_table_in_pdf.Rmd
+++ b/vignettes/awesome_table_in_pdf.Rmd
@@ -263,7 +263,7 @@
c("kableExtra_sm.png", "kableExtra_sm.png"), 50, 50))
```
-`kableExtra` also provides a few inline plotting tools. Right now, there are `spec_hist`, `spec_boxplot`, and `spec_line`. One key feature is that by default, the limits of every subplots are fixed so you can compare across rows.
+`kableExtra` also provides a few inline plotting tools. Right now, there are `spec_hist`, `spec_boxplot`, and `spec_plot`. One key feature is that by default, the limits of every subplots are fixed so you can compare across rows.
```{r}
mpg_list <- split(mtcars$mpg, mtcars$cyl)
@@ -273,7 +273,7 @@
kable_paper(full_width = F) %>%
column_spec(2, image = spec_boxplot(mpg_list)) %>%
column_spec(3, image = spec_hist(mpg_list)) %>%
- column_spec(4, image = spec_line(mpg_list, same_lim = FALSE))
+ column_spec(4, image = spec_plot(mpg_list, same_lim = FALSE))
```
## Row spec