-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rhistory
17 lines (17 loc) · 1.01 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
library(tufte)
# invalidate cache when the tufte version changes
knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tufte'))
options(htmltools.dir.version = FALSE)
data <- data.frame("percentage" = c(0.914, 0.063, 0.0, 0.023), type = c("No pobres", "Pobres", "No pobres", "Pobres"), lvl = c("No extremos", "No extremos", "Extremos", "Extremos"))
ggplot(data, aes(x = factor(type, levels = c("Pobres", "No pobres")) , y = percentage, fill = factor(lvl, levels = c("Extremos", "No extremos")))) +
geom_bar(stat = "identity", alpha = myalpha) +
coord_flip() +
scale_fill_manual(values=c(myblue, myred)) +
# theme(legend.position="none") + # remove legend (that comes #from dummy categories) +
scale_x_discrete(labels = c("NA" = "No pobres", "Pobres" = "Pobres")) +
scale_y_continuous(limits = c(0,1)) +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank(),
axis.text.x = element_text(size=20),
axis.text.y = element_text(size=14),
strip.text.x = element_text(size = 18, color = "black"))