Closed rafapereirabr closed 1 year ago
We have updated the package to support both continuous and discrete scales. Try the following code:
remotes::install_github("ipeadata-lab/ipea_templates")
library(templatesIpea)
library(ggplot2)
data("mtcars")
mtcars <- mtcars %>%
mutate(carb = ifelse(carb == 1,"0-1",
ifelse(carb == 2,"1-2",
ifelse(carb == 3,"2-3",
ifelse(carb == 4,"3-4",NA)))))
# continuous
ggplot() +
geom_point(data=mtcars, aes(x=mpg , y=cyl, color=cyl)) +
scale_color_continuous_ipea()
# discrete
ggplot(data=mtcars, aes(x=mpg , y=cyl, color=carb)) +
geom_point() +
scale_colour_discrete_ipea()
reprex