ggplot2 is a versatile plotting package which allows to produce almost any kind of plot from data stored as a data.frame, by combining unit elements. However, it requires the user to design the plot entirely, from scratch. Many R functions for statistical analyses (linear models, mutlivariate analyses, etc.) output objects of a given class and allow to easily plot classic diagnostics using
plot(), by defining a specialized method for this generic function. This package aims at reproducing this functionality in ggplot2 while benefiting from its improved versatility. It provides two sets of methods : (i) the
augment() methods extract data from the original object and format it as a data.frame (see package broom); (ii) the
autoplot() methods use these data.frames and leverage ggplot2 to produce diagnostic plots.
The package is under development and is not on CRAN yet. To install it, the simplest method is therefore
# install.packages("devtools") devtools::install_github("jiho/autoplot")
All suggestions and improvements are welcome. Suggestions are preferred under the form of Github "issues" (see the tab above, on the top right). Improvements should be submitted under the form of "pull-requests" (again, see the tab above).
The best way to create a pull-request (according to me) is:
fork the repository on GitHub's website. It creates your very own copy of
clone my version the project
git clone https://github.com/jiho/autoplot.git
create a branch
git branch myfeature git checkout myfeature
make the changes you want and commit them to the branch
<code, code> git commit -a
push the branch to your github repository
git remote add mine https://github.com/<yourname>/autoplot.git git push myfeature mine
visit your branch on GitHub's website and create a pull request. It should automatically be made against my master branch.
This way, you can easily update the master branch to get my latest changes and base your next contribution on it (which is necessary for things not to break):
# update the master branch to match mine git checkout master git pull # create a new branch git branch myOtherFeature git checkout myOtherFeature # create a new change <code, code> git commit # push it online git push myOtherFeature mine