Skip to content

Instantly share code, notes, and snippets.

@juanchiem
Created May 17, 2022 13:30
Show Gist options
  • Save juanchiem/5db305a67107d495cd996ea342484a15 to your computer and use it in GitHub Desktop.
Save juanchiem/5db305a67107d495cd996ea342484a15 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(lubridate)
u <- "https://raw.githubusercontent.com/juanchiem/agro_data/master/weather_africa.csv"
sol <- rio::import(u)
sol %>% glimpse
sol %>%
mutate(date1= update(mdy(date), year = 1800)) %>%
ggplot() +
aes(
x=date1,
# x=julian,
y=tmin)+
geom_point(shape = 1, alpha=0.6, size =1) +
geom_smooth(se=TRUE)+
# scale_x_continuous(breaks = seq(0, 365, by = 20))+
# scale_y_continuous(breaks = seq(0, 30, by = 2))+
geom_quantile(method = "rqss", quantiles=0.95,lambda=20,size=1,colour= "red")+
geom_quantile(method = "rqss", quantiles=0.05,lambda=20,size=1,colour= "red")+
theme(axis.text.x = element_text(angle=45, hjust = 1)) +
labs(x="", y="Tmin (C)") +
scale_x_date(date_breaks="1 month", date_labels="%b")+
theme_bw() +
theme(axis.text.x = element_text(angle=45, hjust = 1))
@juanchiem
Copy link
Author

imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment