Last active
March 30, 2022 14:00
-
-
Save juanchiem/95b4d7f8d1f55712e4eb96343fc519ba to your computer and use it in GitHub Desktop.
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
library(tidyverse) | |
dat <- expand.grid(sev = seq(0.01, 0.99, 0.01), | |
inc = seq(0.01, 0.99, 0.01)) %>% | |
mutate(int = inc*sev) | |
dat %>% | |
ggplot(aes(inc, sev, fill= int)) + | |
geom_tile() + | |
viridis::scale_fill_viridis(discrete=FALSE, direction = -1)+ | |
theme_bw() %+replace% | |
theme(plot.caption = element_text(hjust = 0, size = 10, face= "italic"))+ | |
labs( | |
# x="Disease incidence", y="Disease severity", fill = "Disease\nintensity", | |
# caption = "Disease intensity = Disease incidence * Disease severity" | |
x="Incidencia", y="Severidad", fill = "Intensidad", | |
caption = "Intensidad = Incidencia * Severidad (ambos en proporcion 0 a 1)" | |
)+ | |
geom_point(data = data.frame(sev = c(0.1,0.9), inc=c(0.9,0.1), int=0.09), | |
aes(x=inc, y=sev))+ | |
geom_text(data = data.frame(sev = c(0.9,0.1), inc=c(0.1,0.9), int=0.09, lab=c("A", "B")), | |
aes(label=lab, vjust = 0, hjust = -0.5)) | |
Author
juanchiem
commented
Mar 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment