If you use grafify
, please cite
Shenoy, A. R. (2021) grafify: an R package for easy graphs, ANOVAs and post-hoc comparisons. Zenodo. http://doi.org/10.5281/zenodo.5136508
grafify
is now on CRAN and can be installed by typing install.packages("grafify")
.
Any updates not yet on CRAN will be made available here first. To install from GitHub you also need to install the remotes
package. Then type remotes::install_github("ashenoy-cmbi/grafify@*release")
.
grafify
requires the following packages to be installed: broom.mixed
, car
, emmeans
, ggplot2
, Hmisc
, lme4
, lmerTest
, magrittr
, pbkrtest
, purrr
, stats
, tidyr
.
I made this package mainly to plot great-looking graphs quickly while exploring data, and for linear regressions for ANOVA. I also use it to introduce linear models in my teaching. If you’re interested in basic theory and code for statistics written for biologists, also visit Statistics for Micro/Immuno Biologists.
grafify
has five main features (graphs, colour blind-friendly colour schemes, ANOVA & post-hoc comparisons, practice datasets and data simulations):
There are 19 plot_
functions of 6 broad types in grafify
. The plot_scatter..
versions are preferred when there are many data points, plot_dot..
versions have a “cleaner” layout for smaller datasets.
plot_scatterbar_sd
, plot_scatterbox
, plot_scatterviolin
and plot_dotbar_sd
, plot_dotbox
, plot_dotviolin
New since v1.5.0: new plot_
functions like the above but ending in _sc
for same colour or single colour. See vignettes for details.plot_3d_scatterbar
, plot_3d_scatterbox
, plot_4d_scatterbar
, plot_4d_scatterbox
plot_xy_NumGroup
, plot_xy_CatGroup
plot_befafter_colours
, plot_befafter_shapes
plot_qqline
, plot_density
plot_histogram
, and residuals of linear models with plot_qqmodel
New since v1.5.0: plot_qqmodel
which generates a Q-Q plot of model residualsplot_bar_sd
, plot_point_sd
New since v1.5.0: single colour versions of these available as names ending with _sc
The following discreet (qualitative) and continuous (quantitative) palettes are implemented in grafify
:
(The continuous colour scheme based on Paul Tol’s YlOrBl variant is new in v0.2.0.)
Apply these discrete palettes to any ggplot2
object with scale_fill_grafify
, scale_colour_grafify
, scale_fill_grafify2
or scale_colour_grafify2
. Palettes available are: okabe_ito
(see Mike Mol’s blog), bright
, pale
, muted
, dark
, light
, vibrant
, and contrast
colours (see Paul Tol’s blog).
Apply the yellow_conti
continuous colour scheme using scale_fill_grafify_c
and scale_colour_grafify_c
.
Fitting linear models and linear mixed models and obtaining ANOVA tables
simple_anova
, simple_model
,mixed_anova
, mixed_model
, mixed_anova_slopes
& mixed_model_slopes
.The best place to see grafify
in action is the vignettes website, which has detailed description of all functions.
Go to this website for function documentations.