Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- targets <- data.frame(category1 = rep(c('1', '2', '3', '4', '5'), 2), category2 = rep(c('a', 'b'), 5), value = abs(rnorm(10)))
- outcomes <- data.frame(category1 = rep(c('1', '2', '3', '4', '5'), 2), category2 = rep(c('a', 'b'), 5), value = targets$value + rnorm(10, sd = 0.1))
- library(ggplot2)
- ggplot() +
- geom_bar(data = outcomes, mapping = aes(x = category1, y = value, fill = category2), stat='identity', position = 'dodge', alpha = 0.5) +
- geom_point(data = targets, mapping = aes(x = category1, y = value, color = category2), position = position_dodge(width = .9), size = 5) +
- labs(fill = 'Model Estimated Values', color = 'Data Targets') +
- theme_bw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement