Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Depends:
Imports:
graphics,
grDevices,
methods,
stats,
tools,
utils
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(tinyplot,data.frame)
S3method(tinyplot,default)
S3method(tinyplot,density)
S3method(tinyplot,formula)
Expand Down Expand Up @@ -91,6 +92,7 @@ importFrom(graphics,segments)
importFrom(graphics,strwidth)
importFrom(graphics,text)
importFrom(graphics,title)
importFrom(methods,is)
importFrom(stats,aggregate)
importFrom(stats,approx)
importFrom(stats,as.formula)
Expand Down
20 changes: 19 additions & 1 deletion R/tinyplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,16 @@
#' )
#' # reset the theme
#' tinytheme()
#'
#'
#' # tinyplot can be used with pipes without specifying the data argument,
#' # as long as a formula is provided:
#'
#' \dontrun{
#' aq |>
#' subset(Month == "May") |>
#' tinyplot(Temp ~ Wind)
#' }
#'
#' # For more examples and a detailed walkthrough, please see the introductory
#' # tinyplot tutorial available online:
#' # https://grantmcdermott.com/tinyplot/vignettes/introduction.html
Expand Down Expand Up @@ -1489,6 +1498,15 @@ tinyplot.density = function(

}

#' @rdname tinyplot
#' @importFrom methods is
#' @export
tinyplot.data.frame <- function(x = NULL, formula = NULL, ...) {
pars <- as.list(match.call()[-1])
if(!is(pars$formula, "call")) { stop("If the first argument to tinyplot is a data frame, then the second must be a formula.") }
tinyplot(formula, x, ...)
}


#' @export
#' @name plt
Expand Down
12 changes: 12 additions & 0 deletions man/tinyplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.