Skip to content

Commit

Permalink
Closer to where we want to be, but still not there yet
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Jul 31, 2024
1 parent acf8a28 commit d0f5499
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions R/plot_aagi.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#' main = "Air Quality",
#' xlab = "Ozone"
#' )
#'
#'
#' plot_aagi(pressure)
#'
#' @author Adam Sparks, \email{adam.sparks@@curtin.edu.au}
Expand Down Expand Up @@ -87,12 +87,22 @@ plot_aagi <- function(x,
# set new pars
withr::local_par(.new = par_aagi())

if (is.null(xlab)) {
xlab <- names(x[1])
}
# set up x/ylabs if `NULL`
if (is.null(y) && length(x) == 2) {
if (is.null(xlab)) {
xlab <- names(x[[1]])
}

if (is.null(ylab)) {
ylab <- names(x[2])
if (is.null(ylab)) {
ylab <- names(x[[2]])
}
} else {
if (is.null(xlab)) {
xlab <- names(x)
}
if (is.null(ylab)) {
ylab <- names(y)
}
}

xy <- grDevices::xy.coords(x, y)
Expand Down

0 comments on commit d0f5499

Please sign in to comment.