Skip to content

Commit

Permalink
Update sp-slides.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
bpbond committed Sep 6, 2024
1 parent 3571fcc commit 1580e62
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sp-slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,23 @@ dat <- bind_rows(dat)
```

## Observations
## Observations (M)

```{r table}
dat %>%
mutate(Year = year(Date)) %>%
group_by(Year, Site) %>%
summarise(n = sum(n, na.rm = TRUE), .groups = "drop") %>%
pivot_wider(names_from = "Year", values_from = "n", values_fill = 0) %>%
arrange(Site) %>%
arrange(Site) ->
dat_table
dat_table %>%
gt::gt() %>%
fmt_number(suffixing = "K", decimals = 1)
grand_summary_rows(columns = which(sapply(dat_table, is.numeric)),
fmt = ~fmt_number(., scale_by = 1e-6, decimals = 2),
fns = list(label = "Totals", id = "totals", fn = "sum")) %>%
fmt_number(scale_by = 1e-6, decimals = 2)
```

## Observations over time
Expand Down Expand Up @@ -165,7 +171,7 @@ twodays %>%
scale_x_datetime(date_breaks = "1 day") +
ylab("Soil VWC") +
theme(axis.text.x = element_text(angle = 90)) +
ggtitle("TEMPEST control plot") +
ggtitle("Rain event - TEMPEST control plot") +
facet_wrap(~Depth)
```

Expand Down

0 comments on commit 1580e62

Please sign in to comment.