diff --git a/data-raw/tmax-hist.R b/data-raw/tmax-hist.R index 3f9e43bf..213372ad 100644 --- a/data-raw/tmax-hist.R +++ b/data-raw/tmax-hist.R @@ -24,12 +24,13 @@ historical_tmax <- cand %>% tmax_hist <- historical_tmax |> face_temporal() |> + mutate(tmax = tmax / 10) |> filter(between(lubridate::year(date), 1970, 1975) | lubridate::year(date) > 2015) |> mutate(yearmonth = tsibble::yearmonth(date)) |> group_by(yearmonth) |> summarise(tmax = mean(tmax, na.rm = TRUE)) |> face_spatial() |> - select(-c(element:id1)) |> + select(-c(element:last_year)) |> filter(stringr::str_sub(id, 7, 8) >= 76) usethis::use_data(tmax_hist, overwrite = TRUE, compress = "gzip") diff --git a/man/glyph.Rd b/man/glyph.Rd index 65b59028..09aff080 100644 --- a/man/glyph.Rd +++ b/man/glyph.Rd @@ -61,10 +61,10 @@ geom_glyph_box( ) } \arguments{ -\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}} or -\code{\link[ggplot2:aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the -default), it is combined with the default mapping at the top level of the -plot. You must supply \code{mapping} if there is no plot mapping.} +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} \item{data}{The data to be displayed in this layer. There are three options: @@ -82,10 +82,14 @@ will be used as the layer data. A \code{function} can be created from a \code{formula} (e.g. \code{~ head(.x, 10)}).} \item{stat}{The statistical transformation to use on the data for this -layer, as a string.} - -\item{position}{Position adjustment, either as a string, or the result of -a call to a position adjustment function.} +layer, either as a \code{ggproto} \code{Geom} subclass or as a string naming the +stat stripped of the \code{stat_} prefix (e.g. \code{"count"} rather than +\code{"stat_count"})} + +\item{position}{Position adjustment, either as a string naming the adjustment +(e.g. \code{"jitter"} to use \code{position_jitter}), or the result of a call to a +position adjustment function. Use the latter if you need to change the +settings of the adjustment.} \item{...}{Other arguments passed on to \code{\link[ggplot2:layer]{layer()}}. These are often aesthetics, used to set an aesthetic to a fixed value, like diff --git a/vignettes/cubble.Rmd b/vignettes/cubble.Rmd index d4c1bcaf..4f6dd72b 100644 --- a/vignettes/cubble.Rmd +++ b/vignettes/cubble.Rmd @@ -42,11 +42,12 @@ tmax We would also like to summarise the daily recording into monthly to smooth the maximum temperature and since it is also a time dimension operation, we can keep using the long form: ```{r} -tmax <- tmax %>% - face_temporal() %>% - group_by( - month = lubridate::month(yearmonth), - group = as.factor(ifelse(lubridate::year(yearmonth) > 2015, "2016 ~ 2020","1971 ~ 1975"))) %>% +tmax <-tmax %>% + face_temporal() %>% + mutate( + month = lubridate::month(yearmonth), + group = as.factor(ifelse(lubridate::year(yearmonth) > 2015, "2016 ~ 2020","1971 ~ 1975"))) %>% + group_by(month, group)%>% summarise(tmax = mean(tmax, na.rm = TRUE)) tmax diff --git a/vignettes/glyph.Rmd b/vignettes/glyph.Rmd index f5b5378b..ed421498 100644 --- a/vignettes/glyph.Rmd +++ b/vignettes/glyph.Rmd @@ -88,9 +88,10 @@ Taking the output from the [Get started](cubble.html) page, we can visualise the OUTPUT_FROM_GET_STARTED <- tmax_hist %>% filter(between(as.numeric(stringr::str_sub(id, 7, 8)), 76, 90)) %>% face_temporal() %>% - group_by( + mutate( month = lubridate::month(yearmonth), group = as.factor(ifelse(lubridate::year(yearmonth) > 2015, "2016 ~ 2020","1971 ~ 1975"))) %>% + group_by(month, group) %>% summarise(tmax = mean(tmax, na.rm = TRUE)) %>% face_spatial() %>% filter(nrow(ts) == 24) %>%