Created
January 19, 2018 02:29
-
-
Save bhive01/1c35f53904d4085d3e8f948e9c1fa19b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
lagshow <- | |
data.frame(x= rep(1:10, 14), | |
y = rep(1:10, 14), | |
color = rep(rep(c("A", "B"), each = 10), 7), | |
lag = rep(-3:3, each=20) | |
) %>% | |
mutate(x = if_else(color == "A", x-lag, x)) | |
ggplot(lagshow, aes(x = x, y = y, colour = color, shape = color)) + | |
geom_point() + | |
geom_line() + | |
facet_grid(.~lag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment