Created
March 12, 2014 16:36
-
-
Save dsparks/9510857 to your computer and use it in GitHub Desktop.
An example using manipulate to modify a ggplot object. Requires RStudio.
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
aPlotFunction <- function(hh, ss, sz){ | |
zp1 <- qplot(data = cars, x = dist, y = speed, | |
colour = I(hsv(hh/255, 1, 1)), | |
shape = I(ss), | |
size = I(sz)) | |
print(zp1 + theme_bw()) | |
} | |
manipulate( | |
aPlotFunction(hh, ss, sz), | |
hh = slider(0, 255, step = 1, initial = 0), | |
ss = slider(1, 255, step = 1, initial = 1), | |
sz = slider(1, 20, step = 1, initial = 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Excellent!