Skip to content

Commit

Permalink
reproc ccha change fig as total change
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Aug 28, 2024
1 parent cb9172a commit d9181bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions createfigs.R
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,13 @@ toplo <- vegdat %>%
) %>%
pivot_wider(names_from = sample, values_from = dist_m) %>%
na.omit() %>% # this removes any where a zone is missing in sample 1 or 3
mutate(
perchg = (`3` - `1`) / `1`
) %>%
summarise(
perchg = mean(perchg),
.by = c(zone_name_simp)
) %>%
`1` = sum(`1`, na.rm = T),
`3` = sum(`3`, na.rm = T),
.by = zone_name_simp
) %>%
mutate(
perchg = (`3` - `1`) / `1`,
sgn = sign(perchg),
sgn = factor(ifelse(sgn == 0, -1, sgn))
) %>%
Expand All @@ -470,7 +469,7 @@ p <- ggplot(toplo, aes(y = reorder(zone_name_simp, perchg), x = perchg)) +
labs(
x = NULL,
y = NULL,
title = 'Mean % change in transect distance of critical coastal habitats',
title = '% change in total transect distance of critical coastal habitats',
subtitle = '2015 to 2023',
caption = 'Source: FWC FWRI Coastal Wetlands Research Program'
) +
Expand All @@ -483,4 +482,4 @@ p <- ggplot(toplo, aes(y = reorder(zone_name_simp, perchg), x = perchg)) +

png(here::here('figures/cchachange.png'), family = fml, height = 4, width = 8, units = 'in', res = 300)
print(p)
dev.off()
dev.off()
Binary file modified figures/cchachange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d9181bf

Please sign in to comment.