Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. plot.wrap <- function(df, x, y, filename, ...) {
  2. g <- ggplot(df, aes_string(x=x, y=y)) +
  3. geom_point(colour="limegreen", size=3) + theme_light() + ...
  4. ggsave(plot=g, filename=filename)
  5.  
  6. d <- data.frame(A=1:10, B=2:11, C=3:12)
  7. plot.wrap(d, "A", "B", filename="AB.pdf") # A-B plot
  8. plot.wrap(d, "A", "C", filename="AC.pdf") # A-C plot
  9. plot.wrap(d, "B", "C", filename="BC.pdf") # B-C plot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement