How to make common social science diagrams using DiagrammeR
The DiagrammeR package is great for programmatically creating diagrams using the GraphViz language.
However, it can be challenging to figure out how to create common graphs using GraphViz. Therefore, I compiled a list of some common graphs and plots to get you started.
Display hierarchies and relationships between theoretical constructs.
Hierarchy of concepts
Randomized control trial, experiment and control group
Randomized control trial, experiment and control group - top down
2 x 3 factorial experiment with pre-test and post-test
Variables and relationships, directed acyclic graphs (DAG's) etc.
Cause and effect (2 variables)
Cause, mediator and effect (3 variables)
Cause, moderator and effect (3 variables)
Partial mediation with 1 mediator (3 variables)
Structural equation models
Partial mediation with 2 mediators (4 variables)
Latent factors and their indicators etc.
Moderated mediation with latent factor
Flowcharts for inclusion and exclusion of studies.
Meta-analysis flowchart for included and excluded studies
Meta-analysis flowchart for included and excluded studies, with labels