Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Nov 7, 2022
1 parent ccfbbe8 commit 3829b32
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
3 changes: 2 additions & 1 deletion data-raw/tmax-hist.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
20 changes: 12 additions & 8 deletions man/glyph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions vignettes/cubble.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion vignettes/glyph.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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) %>%
Expand Down

0 comments on commit 3829b32

Please sign in to comment.