Last active
July 27, 2017 16:39
-
-
Save WalkerHarrison/9daf9d909c3d88606fcbb8ff4d901d15 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
for (i in x){ | |
wt <- dnorm(x-i, 0, scale) | |
plt <- ggplot(df, aes(x, y, col = wt)) + | |
geom_point(size = pmax(100*wt, 1)) + | |
geom_line(data = smoother[x<=i,], aes(x, y), col = "black") + | |
geom_point(data = smoother[x==i,], aes(x, y), size = 3, | |
col = "black", shape = 21, fill = "white") + | |
scale_color_gradient(low = "dark blue", high = "red") + | |
theme(legend.position = "none") | |
ggsave(plt, filename = paste("kernel_", i, ".png", sep="")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment