Last active
April 10, 2022 13:41
-
-
Save juanchiem/2de3d707cd99f38fad88b39a05472769 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
dat <- tibble::tribble( | |
~date, ~ndvi, | |
"2020-05-18", 0.7655, | |
"2020-06-14", 0.723, | |
"2020-07-12", 0.6178, | |
"2020-08-21", 0.437, | |
"2020-09-07", 0.4763, | |
"2020-09-10", 0.4928, | |
"2020-09-12", 0.4831, | |
"2020-09-22", 0.4774, | |
"2020-10-02", 0.5794, | |
"2020-10-07", 0.606 | |
) %>% | |
mutate(date = lubridate::ymd(date), | |
days = difftime(date, min(date), units="days")) | |
dat %>% | |
ggplot(aes(date, ndvi)) + | |
geom_line() + | |
scale_x_date(breaks = dat$date, | |
name = "", | |
sec.axis = dup_axis(breaks=dat$date, | |
labels = as.character(round(dat$days)), | |
name = "Días desde aplicación")) |
Author
juanchiem
commented
Mar 13, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment