Created
March 30, 2016 13:59
-
-
Save Rekyt/8f3138f5a1492700e4034bd1e91d3dbe to your computer and use it in GitHub Desktop.
Use of stat qq to plot qqplots in ggplot2
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
| # List of qqplots using 'apply()' function | |
| # | |
| library(ggplot2) | |
| data(mtcars) | |
| plot_list = apply(mtcars, 2, function(line) { | |
| my_plot = ggplot(data.frame(x = line), aes(sample = x)) + | |
| stat_qq() + | |
| geom_abline(intercept = mean(line), slope = sd(line)) | |
| return(my_plot) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment