Guest User

Untitled

a guest
Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. raw %>% group_by(dt) %>%
  2. summarise(mean = mean(price, na.rm = TRUE), median = median(price, na.rm = TRUE)) %>%
  3. ggplot(aes(x = dt)) +
  4. geom_rect(aes(xmin = as.Date("2018-01-01"),
  5. xmax = as.Date("2018-01-15"),
  6. ymin = -Inf, ymax = Inf), fill = "gray", alpha = 0.01) +
  7. geom_point(aes(y = mean), col = "blue") +
  8. geom_point(aes(y = median), col = "red") +
  9. scale_x_date(date_breaks = "week") +
  10. theme(axis.text.x = element_text(angle = 90))
Add Comment
Please, Sign In to add comment