Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Month = seq(1,12)
  2. Median_Peak_Duration = c(6,5,4,3,1,2,2,3,4,4,5,5.5)
  3. PeakyMonth = ifelse(Median_Peak_Duration > 3, 'Non-Peaky', 'Peaky')
  4. testDat = data.frame(Month, Median_Peak_Duration,PeakyMonth)
  5.  
  6. testDat %>%
  7. ggvis(x = ~Month, y = ~Median_Peak_Duration, fill = ~PeakyMonth) %>%
  8. layer_bars(width = .8) %>%
  9. # Annotation
  10. layer_lines(x = ~Month, y = 3, strokeDash := 6, strokeWidth := 3) %>%
  11. layer_text(x = 6, y = 4.5, text:= "Some more Text",
  12. fontSize := 12, align := "center", baseline := "top", fill := "black") %>%
  13. layer_text(x = 6, y = 3, text:= "Some Text",
  14. fontSize := 12, align := "center", baseline := "top", fill := "black")
  15.  
  16. testDat %>%
  17. ggvis(x = ~Month, y = ~Median_Peak_Duration, fill = ~PeakyMonth) %>%
  18. layer_bars(width = .8) %>%
  19. # Annotation
  20. layer_lines(x = ~Month, y = 3, strokeDash := 6, strokeWidth := 3) %>%
  21. layer_text(x = 6, y = 4.5, text:= "Some more Text",
  22. fontSize := 12, align := "center", baseline := "top", fill := "black")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement