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 5, 2024
1 parent 045165b commit 3571fcc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sp-slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ theme_set(theme_bw())
library(scales)
library(viridis)
library(gt)
make_depth <- function(research_name) {
depth <- gsub("cm", " cm", substr(research_name, 10, 13))
factor(depth, levels = c("5 cm", "10 cm", "15 cm", "30 cm"))
}
```

![Synoptic sites](synoptic/docs/synoptic_sites.png)
Expand Down Expand Up @@ -111,8 +116,7 @@ dat %>%
arrange(Date) %>%
group_by(research_name) %>%
mutate(cum_n = cumsum(n),
Depth = gsub("cm", " cm", substr(research_name, 10, 13)),
Depth = factor(Depth, levels = c("5 cm", "10 cm", "15 cm", "30 cm"))) ->
Depth = make_depth(research_name)) ->
smry2
p2 <- ggplot(smry2, aes(Date, cum_n, fill = Depth)) +
Expand Down Expand Up @@ -155,8 +159,7 @@ twodays <- twodays[grep("soil_vwc", twodays$research_name),]
# Two days plot that shows a cool midnight rain event
twodays %>%
mutate(Depth = gsub("cm", " cm", substr(research_name, 10, 13)),
Depth = factor(Depth, levels = c("5 cm", "10 cm", "15 cm", "30 cm"))) %>%
mutate(Depth = make_depth(research_name)) %>%
ggplot(aes(TIMESTAMP, Value, color = Depth, group = Sensor_ID)) +
geom_line(na.rm = TRUE) +
scale_x_datetime(date_breaks = "1 day") +
Expand All @@ -171,8 +174,7 @@ teros_dat %>%
mutate(Date = as.Date(TIMESTAMP)) %>%
group_by(Sensor_ID, research_name, Date) %>%
summarise(Value = mean(Value, na.rm = TRUE), .groups = "drop") %>%
mutate(Depth = gsub("cm", " cm", substr(research_name, 10, 13)),
Depth = factor(Depth, levels = c("5 cm", "10 cm", "15 cm", "30 cm"))) ->
mutate(Depth = make_depth(research_name)) ->
full_record
full_record_vwc <- full_record[grep("soil_vwc", full_record$research_name),]
Expand Down

0 comments on commit 3571fcc

Please sign in to comment.