Skip to content

Commit

Permalink
update report
Browse files Browse the repository at this point in the history
  • Loading branch information
langbart committed Aug 31, 2024
1 parent 9f0b651 commit 5a6a041
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions inst/reports/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
31 changes: 21 additions & 10 deletions inst/reports/report.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,29 @@ validated %>%
dplyr::filter(submission_date > "2010-01-01") %>%
dplyr::mutate(landing_site = stringr::str_to_title(landing_site)) %>%
dplyr::select(survey_id, submission_date, landing_site) %>%
tidyr::complete(landing_site, submission_date) %>%
dplyr::mutate(record = ifelse(is.na(survey_id), 0, 1)) %>%
dplyr::group_by(landing_site) %>%
dplyr::mutate(obs = sum(record)) %>%
ggplot(aes(submission_date, reorder(landing_site, obs), fill = as.factor(record))) +
dplyr::mutate(submission_date = lubridate::floor_date(submission_date, "month")) %>%
dplyr::group_by(submission_date, landing_site) %>%
dplyr::summarise(n = dplyr::n()) %>%
dplyr::ungroup() %>%
tidyr::complete(landing_site, submission_date, fill = list(n = 0)) %>%
ggplot(aes(submission_date, reorder(landing_site, n))) +
theme_minimal() +
geom_tile(width = 3) +
geom_tile(aes(submission_date, reorder(landing_site, n), fill = n, alpha = log(n)), color = "white", size = 0.3) +
scale_fill_viridis_c(direction = -1) +
coord_cartesian(expand = FALSE) +
scale_fill_manual(values = c("transparent", "#047474")) +
scale_x_date(date_breaks = "4 months", date_labels = "%y-%b") +
theme(legend.position = "") +
labs(y = "", x = "Date")
guides(alpha = "none") +
scale_x_date(
date_breaks = "4 month",
date_labels = "%y-%b",
expand = c(0, 0)
) +
labs(
x = "Month of the year",
fill = "Number of surveys",
y = ""
)+
theme(legend.position = "bottom",
panel.grid.minor = element_blank())
```

Expand Down

0 comments on commit 5a6a041

Please sign in to comment.