Last active
November 13, 2015 19:46
-
-
Save nmcglincy/39063b97503c39aeb7a7 to your computer and use it in GitHub Desktop.
Took me too long to figure this out...
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(ggplot2) | |
df = data.frame(foo = rep(c("foo", "bar"), each = 50), | |
bar = c(rep("tom", 33), | |
rep("harry", 33), | |
rep("dick", 34)), | |
big = runif(n = 100), | |
small = rnorm(n = 100)) | |
testPlot = function(df, var1, var2) { | |
ggplot(df, | |
aes_string(x = "big", | |
y = "small", | |
colour = var1, | |
size = var2)) + | |
geom_point() | |
} | |
testPlot(df = df, | |
var1 = "foo", | |
var2 = "bar") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment