Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Month = seq(1,12)
- Median_Peak_Duration = c(6,5,4,3,1,2,2,3,4,4,5,5.5)
- PeakyMonth = ifelse(Median_Peak_Duration > 3, 'Non-Peaky', 'Peaky')
- testDat = data.frame(Month, Median_Peak_Duration,PeakyMonth)
- testDat %>%
- ggvis(x = ~Month, y = ~Median_Peak_Duration, fill = ~PeakyMonth) %>%
- layer_bars(width = .8) %>%
- # Annotation
- layer_lines(x = ~Month, y = 3, strokeDash := 6, strokeWidth := 3) %>%
- layer_text(x = 6, y = 4.5, text:= "Some more Text",
- fontSize := 12, align := "center", baseline := "top", fill := "black") %>%
- layer_text(x = 6, y = 3, text:= "Some Text",
- fontSize := 12, align := "center", baseline := "top", fill := "black")
- testDat %>%
- ggvis(x = ~Month, y = ~Median_Peak_Duration, fill = ~PeakyMonth) %>%
- layer_bars(width = .8) %>%
- # Annotation
- layer_lines(x = ~Month, y = 3, strokeDash := 6, strokeWidth := 3) %>%
- layer_text(x = 6, y = 4.5, text:= "Some more Text",
- fontSize := 12, align := "center", baseline := "top", fill := "black")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement