diff --git a/R/sits_plot.R b/R/sits_plot.R index f385f914b..8fc9d50ec 100644 --- a/R/sits_plot.R +++ b/R/sits_plot.R @@ -413,8 +413,8 @@ plot.patterns <- function(x, y, ..., bands = NULL, year_grid = FALSE) { if(year_grid) plot.df <- plot.df %>% - dplyr::mutate(year = format(Time, format="%Y")) %>% - dplyr::mutate(Time = as.Date(format(Time, format="2000-%m-%d"))) + dplyr::mutate(year = format(.data[["Time"]], format = "%Y")) %>% + dplyr::mutate(Time = as.Date(format(.data[["Time"]], format = "2000-%m-%d"))) # Plot temporal patterns gp <- ggplot2::ggplot(plot.df, ggplot2::aes( diff --git a/man/plot.patterns.Rd b/man/plot.patterns.Rd index c3523aaa1..23889de1c 100644 --- a/man/plot.patterns.Rd +++ b/man/plot.patterns.Rd @@ -4,7 +4,7 @@ \alias{plot.patterns} \title{Plot patterns that describe classes} \usage{ -\method{plot}{patterns}(x, y, ..., bands = NULL) +\method{plot}{patterns}(x, y, ..., bands = NULL, year_grid = FALSE) } \arguments{ \item{x}{Object of class "patterns".} @@ -14,6 +14,9 @@ \item{...}{Further specifications for \link{plot}.} \item{bands}{Bands to be viewed (optional).} + +\item{year_grid}{Plot a grid of panels using labels as columns and +years as rows. Default is FALSE.} } \value{ A plot object produced by ggplot2