Last active
July 27, 2023 01:25
-
-
Save juanchiem/645d21a90da184c9733fe3134ea225ed to your computer and use it in GitHub Desktop.
ordenar_meses_summer_season
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gruesa <- format(ISOdate(2000, c(6:12,1:3), 1), "%B") | |
tibble::tribble( | |
~sitio, ~pp_agosto, ~pp_septiembre, ~pp_octubre, ~pp_noviembre, ~pp_diciembre, ~pp_enero, ~pp_febrero, ~pp_marzo, | |
"CHASCOMUS", 0, 0, 14L, 22L, 30L, 52L, 27L, 94L, | |
"RIVERA", 0, 50, 48L, 109L, 15L, 158L, 25L, 85L | |
) |> | |
pivot_longer(contains("pp"), | |
names_prefix = "pp_") |> | |
group_by(sitio) |> | |
mutate(csum = cumsum(value)) |> | |
ungroup() |> | |
mutate(name = factor(name, levels = gruesa)) %>% | |
arrange(name) |> | |
ggplot() + | |
aes(x=name, y=csum, group=1) + | |
geom_line()+ | |
facet_wrap("sitio") + | |
theme(axis.text.x = element_text( | |
angle = 45, hjust = 1, vjust = 1)) |
Author
juanchiem
commented
Jul 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment