Skip to content

Commit

Permalink
Update ssurgo-scale.R
Browse files Browse the repository at this point in the history
  • Loading branch information
smroecker committed May 3, 2024
1 parent 68420f5 commit 4a8e530
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions ssurgo-scale.R
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,50 @@ test |>
facet_wrap(~projectscale) +
ggtitle("Map unit Entropy by Survey Order, Map Scale and Decade")


# survey area complexity
test <- le |>
inner_join(mu, by = "areasymbol") |>
group_by(decade, mukind) |>
summarize(n = length(mukey)) |>
ungroup()

ggplot(test, aes(y = n, x = decade, col = mukind)) +
geom_line(size = 2) +
ggtitle("Trend in Map Unit Kind by Decade")


test <- le |>
inner_join(mu, by = "areasymbol") |>
group_by(decade, mukind, projectscale) |>
summarize(n = length(mukey)) |>
ungroup()

test_N <- test |>
group_by(decade, projectscale) |>
summarize(N = sum(n)) |>
ungroup()

test2 <- test |>
left_join(test_N, by = c("decade", "projectscale")) |>
mutate(pct = round(n / N * 100))


test2 |>
filter(projectscale %in% c(12000, 15840, 24000) & !is.na(mukind)) |>
ggplot(aes(y = n, x = decade, col = mukind)) +
geom_line(size = 2) +
facet_wrap(~projectscale) +
ylab("Count (n)") +
ggtitle("Trend in Map Unit Kind by Decade")


test2 |>
filter(projectscale %in% c(12000, 15840, 24000) & !is.na(mukind)) |>
ggplot(aes(y = pct, x = decade, col = mukind)) +
geom_line(size = 2) +
facet_wrap(~projectscale) +
ylab("percent (%)") +
ggtitle("Trend in Map Unit Kind by Decade")


0 comments on commit 4a8e530

Please sign in to comment.