{"id":15292985,"url":"https://github.com/ashenoy-cmbi/grafify","last_synced_at":"2025-04-06T20:12:57.957Z","repository":{"id":41513204,"uuid":"325137264","full_name":"ashenoy-cmbi/grafify","owner":"ashenoy-cmbi","description":"Easy grafs, ANOVAs and posthoc comparisons. ","archived":false,"fork":false,"pushed_at":"2025-03-15T13:56:16.000Z","size":120277,"stargazers_count":48,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T19:07:06.911Z","etag":null,"topics":["ggplot2","linear-models","post-hoc-comparisons","r","statistics","vignettes"],"latest_commit_sha":null,"homepage":"https://grafify-vignettes.netlify.app","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashenoy-cmbi.png","metadata":{"files":{"readme":"Readme.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-28T23:17:03.000Z","updated_at":"2025-03-15T13:56:20.000Z","dependencies_parsed_at":"2025-03-01T11:45:47.962Z","dependency_job_id":null,"html_url":"https://github.com/ashenoy-cmbi/grafify","commit_stats":{"total_commits":143,"total_committers":2,"mean_commits":71.5,"dds":0.006993006993006978,"last_synced_commit":"2eb4d286e1246d1ca1f1ce2f0e698b0c8b5ef348"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashenoy-cmbi%2Fgrafify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashenoy-cmbi%2Fgrafify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashenoy-cmbi%2Fgrafify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashenoy-cmbi%2Fgrafify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashenoy-cmbi","download_url":"https://codeload.github.com/ashenoy-cmbi/grafify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ggplot2","linear-models","post-hoc-comparisons","r","statistics","vignettes"],"created_at":"2024-09-30T16:36:51.267Z","updated_at":"2025-04-06T20:12:57.928Z","avatar_url":"https://github.com/ashenoy-cmbi.png","language":"R","funding_links":[],"categories":["Data and models"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n### **Latest version: v5.0.0.1 on  [CRAN](https://CRAN.R-project.org/package=grafify) \u0026 GitHub** \n\n### Features\n\n`grafify` has three main features: \n\n1. plotting great-looking graphs for quick-n-easy data exploration with few lines of code\n2. apply colour blind-friendly palettes to graphs plotted with `grafify` or `ggplot2`\n3. use linear models for ANOVA (including those with randomised block designs and repeated-measures) \u0026 post-hoc comparisons (estimated marginal means, confidence intervals and *P* values)\n\nThe [vignettes website](https://grafify-vignettes.netlify.app) has detailed help on usage and latest [release notes are here](https://grafify.shenoylab.com/release_notes.html).\n\nAs an example, you could write this to plot bar/SD graph from a 2-way ANOVA data with randomised blocks:\n\n```{r, eval = TRUE, include=FALSE}\nlibrary(grafify)\n```\n\n\n```{r plot1, eval = F, fig.height=4}\nplot_4d_scatterbar(data = data_2w_Festing, \n                   xcol = Strain,\n                   ycol = GST,\n                   bars = Treatment,\n                   shapes = Block)\n```\n\n\n```{r echo=FALSE, eval = F}\nggsave(\"fig1.jpg\", height = 4.5)\n```\n\n\n```{r, fig1, echo = F, out.width=\"90%\"}\nknitr::include_graphics(\"man/figures/fig1.jpg\")\n```\n\ninstead of all this! \n\n```{r, 2wanova, eval=FALSE}\nggplot2::ggplot(data = data_2w_Festing,\n       aes(x = Strain,\n           y = GST,\n           group = interaction(Strain,\n                               Treatment)))+\n  stat_summary(geom = \"bar\",\n               aes(fill = Treatment),\n               position = position_dodge(width = 0.8), \n               fun = \"mean\")+\n  geom_point(aes(shape = Block),\n             size = 3, stroke = 1,\n             position = position_jitterdodge(jitter.width = .2,\n                                            dodge.width = .8))+\n  stat_summary(geom = \"errorbar\",\n               width = .2, size = 1,\n               fun.data = \"mean_sdl\",\n               fun.args = list(mult = 1),\n               position = position_dodge(width = 0.8))+\n  scale_shape_manual(values = 21:22)+\n  theme_classic(base_size = 21)+\n  theme(axis.text.x = element_text(angle = 45, hjust = 1))+\n  scale_fill_manual(values = c(as.vector(graf_palettes$okabe_ito[1:2])))\n```\n\n\nTwo other features including practice datasets (with randomised blocks), and data simulation for power analyses. The first three features are better documented at present.\n\n#### Graphs\n\n1. Easily plot data as scatter/dot plots with boxes, violins or bars with `plot_` functions of 6 broad types. \n\n     a. Two variables (one categorical \u0026 one numeric): these graphs either use scatter (or also called jitter) or dot plot geometries: `plot_scatterbar_sd`, `plot_scatterbox`, `plot_scatterviolin` or `plot_dotbar_sd`, `plot_dotbox`, `plot_dotviolin`\n     b. One-way or two-way ANOVA designs with or without randomised blocks (3 or 4 dimensions or variables): `plot_3d_point_sd`, `plot_3d_scatterbar`, `plot_3d_scatterbox`,  `plot_3d_scatterviolin` or `plot_4d_point_sd`, `plot_4d_scatterbar`, `plot_4d_scatterbox`, `plot_4d_scatterviolin`\n     c. Matched before-after graphs: `plot_befafter_colours`, `plot_befafter_shapes`, `plot_befafter_box`     \n     c. Quantitative X \u0026 Y, plus a third variable: `plot_xy_NumGroup`, `plot_xy_CatGroup` \n     d. Data distributions: `plot_qqline`, `plot_density` `plot_histogram`, and model diagnostics with `plot_qqmodel`, `plot_qq_gam`, `plot_lm_predict` and `plot_gam_predict`\n     f. Graphs with SD, SEM or CI95 error bars: `plot_point_sd`, `plot_scatterbar_sd`, `plot_3d_scatterbar`\n  \n  \n```{r, all-graphs, echo = F, out.width=\"90%\"}\nknitr::include_graphics(\"man/figures/all_graphsv3.2.0.png\")\n```\n\n#### Colourblind-friendly colour schemes\n\nThe following 12 categorical (qualitative/discreet) and 5 quantitative (3 sequential and 2 divergent) palettes are implemented in `grafify` for making graphs with `plot_` functions. \n\nIn addition, `scale_fill_grafify` and `scale_colour_grafify` functions can be used to apply all `grafify` palettes to any `ggplot2` object.\n\n```{r, image-palettes, echo = F, out.width=\"90%\"}\nknitr::include_graphics(\"man/figures/grafify_palettesv320.png\")\n```\n\nAll palettes are colourblind-friendly. (See Mike Mol's [blog](https://mikemol.github.io/technique/colorblind/2018/02/11/color-safe-palette.html) and Paul Tol's [blog](https://personal.sron.nl/~pault/#sec:qualitative). Additional colour schemes were chosen from [`cols4all` package](https://github.com/cols4all/cols4all-R)).\n    \n#### `grafify` theme \u0026 adding log-scales\n\nThe `theme_grafify` function is a modification of `theme_classic` and enables graphs plotted with `ggplot2` to have a `grafify`-like appearance. \n\n`plot_logscales` lets you take any `ggplot2` object and transform Y, X or both axes into `log2` or `log10` values, and latter will also show log10 tick marks. \n    \n#### Linear models for ANOVA\n\nGet ANOVA tables and linear models with these easy wrappers.\n\n  a. linear models for ordinary ANOVA: `simple_anova`, `simple_model`, `ga_model`, `ga_anova`.\n  b. linear mixed effects for repeated-measures and randomised-block design ANOVA: `mixed_anova`, `mixed_model`, `mixed_anova_slopes`, `mixed_model_slopes`, `ga_model`, `ga_anova`.\n  c. plot model residuals with `plot_qqmodel` and `plot_qq_gam`.\n  d. plot model predictions with `plot_lm_predict` and `plot_gam_predict`.\n\n#### Post-hoc comparisons \u0026 Estimated Marginal Means (easy wrappers for `emmeans`)\n\nPerform post-hoc comparisons based on fitted models for response variables and slopes. Get Estimated Marginal Means, *P* values, parameter estimates with CI95 with these wrappers.\n  \n  a. `posthoc_Pariwise`, `posthoc_Levelwise` \u0026 `posthoc_vsRef`\n  b. `posthoc_Trends_Pairwise`, `posthoc_Trends_Levelwise` \u0026 `posthoc_Trends_vsRef`\n  \n#### Data simulation\n\nGenerating random one-way and two-way data based on mean and SD and residual error.\n\n  a. one-way designs: `make_1way_data`, `make_1way_rb_data`\n  b. two-way designs: `make_2way_data`, `make_2way_rb_data`\n  \n  \n#### Data summaries\n\n`table_summary` is simple function to obtain mean, median and SD by groups, and `table_x_reorder` is for working with factors. \n\n### Vignettes\n\nThe best place to see `grafify`  in action is the [vignettes](https://grafify-vignettes.netlify.app) website, which has detailed description of all functions.\n\n### **Latest version: v5.0.0.1 on [CRAN](https://CRAN.R-project.org/package=grafify) and GitHub** \n\nFind out about [latest updates here](https://grafify.shenoylab.com/release_notes.html).\n\n### Citing `grafify`\n\nShenoy, A. R. (2021) grafify: an R package for easy graphs, ANOVAs and post-hoc comparisons. Zenodo. http://doi.org/10.5281/zenodo.5136508\n\nLatest DOI for all versions: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5136507.svg)](https://doi.org/10.5281/zenodo.5136507)\n\n### Installation\n\n`grafify` is now on [CRAN](https://CRAN.R-project.org/package=grafify) and can be installed by typing `install.packages(\"grafify\")`.\n\nAny 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\")`.\n\n`grafify` requires the following packages to be installed: `car`, `emmeans`, `ggplot2`, `Hmisc`, `lme4`, `lmerTest`, `magrittr`, `mgcv`, `patchwork`, `purrr`, `stats`, `tidyr`.\n\n### Motivation behind `grafify`\n\nI made this package mainly for exploring data by quickly making graphs of different types. Secondly, to implement linear regressions for ANOVA. I also use it to introduce linear models in my teaching, including the analyses of randomised block designs to new users. \n\n### Statistics for Micro/immuno biologists\n\nAlso visit Statistics for [Micro/Immuno Biologists](https://biostats.shenoylab.com/) for basic statistics theory and data analyses in R.\n\n### Function references\n\nGo to this [website](https://ashenoy-cmbi.github.io/grafify/index.html) for function documentations.\n\n### Hexsticker\n\n```{r, image-1hex, echo = F, out.width=\"150px\"}\nknitr::include_graphics(\"man/figures/grafify.png\")\n```\n\n### Status\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/ashenoy-cmbi/grafify/workflows/R-CMD-check/badge.svg)](https://github.com/ashenoy-cmbi/grafify/actions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashenoy-cmbi%2Fgrafify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashenoy-cmbi%2Fgrafify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashenoy-cmbi%2Fgrafify/lists"}