From df55d6a0297abe14c2368fe1ece583317ce153d7 Mon Sep 17 00:00:00 2001 From: Jack Davison Date: Thu, 8 Aug 2024 14:04:37 +0100 Subject: [PATCH] docs: fix docs --- NEWS.md | 6 +++++- R/plotPD.R | 4 +--- man/plotPD.Rd | 11 ++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/NEWS.md b/NEWS.md index d9b8e1d..7942011 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # deweather (development version) +## New Features + +* The plot assemblies in `plotPD()` and `testMod()` are now powered by `{patchwork}`. This will allow for more post-hoc control of the plot assembly using `&` for example. + ## Bug fixes * Fixed an issue where `buildMod()` would fail if there wasn't a character variable (e.g., "weekday"). @@ -56,4 +60,4 @@ # deweather 0.7-1 -* Development version of `{deweather}`. +* First development version of `{deweather}`. diff --git a/R/plotPD.R b/R/plotPD.R index 847c1b3..5ea18e5 100644 --- a/R/plotPD.R +++ b/R/plotPD.R @@ -6,9 +6,7 @@ #' @param ylim user-specified `ylim`. #' @param ylab y-axis label. By default this is the pollutant name. #' @param intervals Number of intervals to to calculate partial dependence over. -#' @param col Colour(s) to use for the lines/points/uncertainty ribbons. If -#' multiple colours are provided (e.g., `cols = c("tomato", "royalblue")`), -#' they will be cycled through until all variables are plotted. +#' @param col Colour for the panels. Passed to [openair::openColours()]. #' @param nrow Number of rows for the plots. #' @param polar.wd Plot the any wind direction components, labelled "wd", on a #' polar axis? Defaults to `FALSE`. diff --git a/man/plotPD.Rd b/man/plotPD.Rd index 7896dbd..e3cfb5d 100644 --- a/man/plotPD.Rd +++ b/man/plotPD.Rd @@ -29,9 +29,7 @@ variables.} \item{ylab}{y-axis label. By default this is the pollutant name.} -\item{col}{Colour(s) to use for the lines/points/uncertainty ribbons. If -multiple colours are provided (e.g., \code{cols = c("tomato", "royalblue")}), -they will be cycled through until all variables are plotted.} +\item{col}{Colour for the panels. Passed to \code{\link[openair:openColours]{openair::openColours()}}.} \item{nrow}{Number of rows for the plots.} @@ -46,8 +44,11 @@ properly, e.g., by subscripting the "2" in "NO2".} data to extract plot components and plotting them in other ways.} } \value{ -Invisibly returns a list containing the plot and the data used to -make the plot to allow post processing, e.g., modifying the \code{ggplot}. +Invisibly returns a list containing the plot, \code{plot}, a list of +individual plots, \code{panels}, and a list of the data used to create them, +\code{data}. \code{plot} is a \link[patchwork:patchwork-package]{patchwork} object, so +can be further manipulated using \code{&} and +\link[ggplot2:ggplot2-package]{ggplot2}. } \description{ Function to plot partial dependence plots with bootstrap uncertainties