SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. targets <- data.frame(category1 = rep(c('1', '2', '3', '4', '5'), 2), category2 = rep(c('a', 'b'), 5), value = abs(rnorm(10)))
  2. 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))
  3.  
  4. library(ggplot2)
  5.  
  6. ggplot() +
  7.   geom_bar(data = outcomes, mapping = aes(x = category1, y = value, fill = category2), stat='identity', position = 'dodge', alpha = 0.5) +
  8.   geom_point(data = targets, mapping = aes(x = category1, y = value, color = category2), position = position_dodge(width = .9), size = 5) +
  9.   labs(fill = 'Model Estimated Values', color = 'Data Targets') +
  10.   theme_bw()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top