LAPOP Save
lapop_save.RdThis function creates exports graphs created using the LAPOP templates.
Examples
df <- data.frame(
cat = c("Far Left", 1, 2, 3, 4, "Center", 6, 7, 8, 9, "Far Right"),
prop = c(4, 3, 5, 12, 17, 23, 15, 11, 5, 4, 1),
proplabel = c("4%", "3%", "5%", "12%", "17%", "23%", "15%", "11%", "5%", "4%", "1%")
)
myfigure <- lapop_hist(df,
main_title = "Centrists are a plurality among Peruvians",
subtitle = "Distribution of ideological preferences",
source_info = "Peru, 2019",
ymax = 27
)
f <- file.path(tempdir(), "fig1.svg")
lapop_save(myfigure, f, format = "svg", width_px = 800)
#> agg_record_903219743
#> 2