Skip to content

Commit

Permalink
Fix removal of monthday and yearday gg_season wrap formats
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Sep 25, 2024
1 parent 9e7fef1 commit 8b9528e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# feasts (development version)

## Bug fixes

* Fixed `gg_season()` not working with daily data showing seasonality > 1 week.

# feasts 0.4.0

## New features
Expand Down
18 changes: 9 additions & 9 deletions R/graphics.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ time_identifier <- function(idx, period, base = NULL, within = NULL, interval){
if(interval >= months(1)){
formats <- formats[c("Month", "Year", "Yearmonth", "Date")]
} else if (interval >= lubridate::weeks(1)){
formats <- formats[c("Monthday", "Yearday", "Week", "Month", "Year",
formats <- formats[c("Week", "Month", "Year",
"Yearweek", "Yearmonth", "Date")]
} else if (interval >= lubridate::days(1)){
formats <- formats[c("Weekday", "Monthday", "Yearday", "Week", "Month", "Year",
formats <- formats[c("Weekday", "Week", "Month", "Year",
"Yearweek", "Yearmonth", "Date")]
}
}
Expand Down Expand Up @@ -181,13 +181,13 @@ guess_plot_var <- function(x, y){
#' @param data A tidy time series object (tsibble)
#' @param y The variable to plot (a bare expression). If NULL, it will
#' automatically selected from the data.
#' @param period The seasonal period to display. If NULL (default),
#' the largest frequency in the data is used. If numeric, it represents
#' the frequency times the interval between observations. If a string
#' (e.g., "1y" for 1 year, "3m" for 3 months, "1d" for 1 day,
#' "1h" for 1 hour, "1min" for 1 minute, "1s" for 1 second),
#' it's converted to a Period class object from the lubridate package.
#' Note that the data must have at least one observation per seasonal period,
#' @param period The seasonal period to display. If NULL (default),
#' the largest frequency in the data is used. If numeric, it represents
#' the frequency times the interval between observations. If a string
#' (e.g., "1y" for 1 year, "3m" for 3 months, "1d" for 1 day,
#' "1h" for 1 hour, "1min" for 1 minute, "1s" for 1 second),
#' it's converted to a Period class object from the lubridate package.
#' Note that the data must have at least one observation per seasonal period,
#' and the period cannot be smaller than the observation interval.
#' @param facet_period A secondary seasonal period to facet by
#' (typically smaller than period).
Expand Down

0 comments on commit 8b9528e

Please sign in to comment.