{
# Access dummy demography dataset
data(demog.data)
levels(demog.data$SEX) <- c("Female", "Male")
# A ggplot object is returned
p1 <- bar.plot(parent.df = demog.data, y.col = "SEX",
x.label= "Gender", y.label = "Percentage of Subjects",
category.col = "REGION", category.label = "Region",
y.limits = c(0, 0.35), y.ticks = seq(0, 0.5, 0.05),
bar.position= "dodge",
category.palette = RColorBrewer::brewer.pal(n=5, name = "Dark2"),
text.size =4, text.buffer=.025, killMissing = TRUE)
print(p1)
}
Run the code above in your browser using DataLab