Learn R Programming

grafify (version 5.0.0)

Easy Graphs for Data Visualisation and Linear Models for ANOVA

Description

Easily explore data by plotting graphs with a few lines of code. Use these ggplot() wrappers to quickly draw graphs of scatter/dots with box-whiskers, violins or SD error bars, data distributions, before-after graphs, factorial ANOVA and more. Customise graphs in many ways, for example, by choosing from colour blind-friendly palettes (12 discreet, 3 continuous and 2 divergent palettes). Use the simple code for ANOVA as ordinary (lm()) or mixed-effects linear models (lmer()), including randomised-block or repeated-measures designs, and fit non-linear outcomes as a generalised additive model (gam) using mgcv(). Obtain estimated marginal means and perform post-hoc comparisons on fitted models (via emmeans()). Also includes small datasets for practising code and teaching basics before users move on to more complex designs. See vignettes for details on usage . Citation: .

Copy Link

Version

Install

install.packages('grafify')

Monthly Downloads

961

Version

5.0.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Avinash R Shenoy

Last Published

March 9th, 2025

Functions in grafify (5.0.0)

graf_palettes

List of palettes available in grafify package
make_1way_rb_data

Make one-way or two-way independent group or randomised block design data.
make_2way_data

Make one-way or two-way independent group or randomised block design data.
get_graf_colours

Get graf internal
graf_col_palette_default

Call grafify palettes for scale & fill functions
make_1way_data

Make one-way or two-way independent group or randomised block design data.
make_2way_rb_data

Make one-way or two-way independent group or randomised block design data.
graf_col_palette

Call grafify palettes for scale & fill functions
mixed_anova

ANOVA table from linear mixed effects analysis.
graf_colours

List of hexcodes of colours in grafify palettes
plot_3d_scatterbox

Plot a scatter and box plot for 1-way ANOVAs with matched shapes mapped to blocking factor.
plot_3d_scatterbar

Plot a bar graph for 1-way ANOVAs with matched shapes mapped to blocking factor.
plot_4d_scatterbar

Plot scatter plot with bar & error bars for 2-way ANOVAs with or without a blocking factor.
plot_3d_point_sd

Plot of mean & error bars for 1-way ANOVAs with matched shapes mapped to blocking factor.
mixed_model

Model from a linear mixed effects model
plot_4d_point_sd

Plot mean & error bars for 2-way ANOVAs with or without a blocking factor.
mixed_anova_slopes

ANOVA table from linear mixed effects analysis.
mixed_model_slopes

Model from a linear mixed effects model with varying slopes
plot_3d_scatterviolin

Plot a scatter with violin & box plot for 1-way ANOVAs with matched shapes mapped to blocking factor.
plot_4d_scatterbox

Plot scatter, box & whiskers for 2-way ANOVAs with or without a blocking factor.
plot_dotviolin

Plot a dotplot on a violin plot with two variables.
plot_density

Plot density distribution of data.
plot_dotbar_sd

Plot a dotplot on a bar graph with SD error bars with two variables.
plot_dotbox

Plot a dotplot on a boxplot with two variables.
plot_befafter_shapes

Plot a before-after plot with lines joining shape-matched symbols.
plot_gam_predict

Plot prediction of gam model
plot_befafter_colours

Plot a before-after plot with lines joining colour-matched symbols.
plot_4d_scatterviolin

Plot scatter, box & violin for 2-way ANOVAs with or without a blocking factor.
plot_grafify_palette

See grafify colour palettes
plot_befafter_box

Before-after style graph with a boxplot
plot_qq_gam

Plot model diagnostics for generalised additive models
plot_scatterbox

Plot a scatter plot on a boxplot with two variables.
plot_qqline

Plot quantile-quantile (QQ) graphs from data.
plot_logscale

Add log transformations to graphs
plot_lm_predict

Plot data and predictions from linear model
plot_point_sd

Plot a point as mean with SD error bars using two variables.
plot_scatterviolin

Plot a scatter plot on a violin plot with two variables.
plot_qqmodel

Plot quantile-quantile (QQ) graphs from residuals of linear models.
plot_histogram

Plot data distribution as histograms.
plot_scatterbar_sd

Plot scatter dots on a bar graph with SD error bars with two variables.
posthoc_Trends_Levelwise

Use emtrends to get level-wise comparison of slopes from a linear model.
plot_xy_NumGroup

Plot points on a quantitative X - Y plot & a numeric grouping variable.
posthoc_Levelwise

Level-wise post-hoc comparisons from a linear or linear mixed effects model.
plot_xy_CatGroup

Plot points on a quantitative X - Y plot & a categorical grouping variable.
scale_fill_grafify

scale_colour_ and scale_fill_ functions
scale_colour_grafify

scale_colour_ and scale_fill_ functions
theme_grafify

A modified theme_classic() for grafify-like graphs.
posthoc_Trends_Pairwise

Use emtrends to get pairwise comparison of slopes from a linear model.
posthoc_vsRef

Post-hoc comparisons to a control or reference group.
posthoc_Trends_vsRef

Use emtrends to get level-wise comparison of slopes from a linear model.
posthoc_Pairwise

Pairwise post-hoc comparisons from a linear or linear mixed effects model.
simple_anova

ANOVA table from a linear model fit to data.
simple_model

Model from a linear model fit to data.
table_summary

Get numeric summary grouped by factors
table_x_reorder

Reordering groups along X-axis
ga_anova

ANOVA table from a generalised additive model (gam)
data_2w_Festing

Data from two-way ANOVA with randomised block design of treatments of strains of mice.
data_2w_Tdeath

In vitro measurement of percentage cell death - two-way ANOVA design with repeated measures, and randomised blocks.
ga_model

Fit a generalised additive model (gam)
data_zooplankton

Time-series data on zooplankton in lake Menon.
data_cholesterol

Hierarchical data from 25 subjects either treated or not at 5 hospitals - two-way ANOVA design with repeated measures.
data_doubling_time

Doubling time of E.coli measured by 10 students three independent times.
data_1w_death

In vitro experiments measuring percentage cell death in three genotypes of cells.
data_t_pratio

Matched data from two groups where ratio between them is consistent.
data_t_pdiff

Matched data from two groups where difference between them is consistent.