项目作者: csdaw

项目描述 :
ggplot2 extension inspired by GraphPad Prism
高级语言: R
项目地址: git://github.com/csdaw/ggprism.git
创建时间: 2020-03-29T14:59:24Z
项目社区:https://github.com/csdaw/ggprism

开源协议:

下载


" class="reference-link">ggprism

R-CMD-check
Codecov test
coverage
CRAN
version
Website
https://csdaw.github.io/ggprism
DOI

The ggprism package provides various themes, palettes, and other
useful functions to customise ggplots and give them the ‘GraphPad
Prism’
look.

Install

Install the latest version from CRAN:

  1. install.packages("ggprism")

Install the development version from GitHub:

  1. remotes::install_github("csdaw/ggprism")

How to Use

See the Getting
Started
page for
a quick overview of ggprism features. Detailed examples and
instructions can be found below and on the ggprism
website
.

  1. library(ggplot2)
  2. library(ggprism)
  3. tg <- ToothGrowth
  4. tg$dose <- as.factor(tg$dose)
  5. base <- ggplot(tg, aes(x = dose, y = len)) +
  6. geom_violin(aes(colour = dose, fill = dose), trim = FALSE) +
  7. geom_boxplot(aes(fill = dose), width = 0.2, colour = "black") +
  8. scale_y_continuous(limits = c(-5, 40))
  9. p_vals <- tibble::tribble(
  10. ~group1, ~group2, ~p.adj, ~y.position,
  11. "0.5", "1", 8.80e-14, 35,
  12. "0.5", "2", 1.27e-7, 39
  13. )
  1. base
  2. base +
  3. scale_color_prism("floral") +
  4. scale_fill_prism("floral") +
  5. guides(y = "prism_offset_minor") +
  6. theme_prism(base_size = 16) +
  7. theme(legend.position = "none") +
  8. add_pvalue(p_vals, label = "p = {p.adj}", tip.length = 0, label.size = 4)
  9. #> Warning: The S3 guide system was deprecated in ggplot2 3.5.0.
  10. #> ℹ It has been replaced by a ggproto system that can be extended.
  11. #> This warning is displayed once every 8 hours.
  12. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
  13. #> generated.

Feedback and Contributions

Any feedback, questions, and suggestions are welcome and should be
shared via GitHub
discussions
.

Bug reports should be submitted via GitHub
issues
with a minimal
reproducible example, e.g. using the
reprex package.

Contributions to ggprism are also welcome and pull requires should
also be submitted via GitHub
issues
. Please fork/clone this
repository and create a new branch to develop your contribution in.
Some ways to contribute might include:

  • Updates and corrections to documentation
  • Examples and vignettes for existing functions
  • Bug fixes
  • New functions with associated documentation, examples, and tests

Cite

I would be very grateful if you could cite this package if you use it in
your publication:

Charlotte Dawson (2024). ggprism: A ‘ggplot2’ Extension Inspired by
‘GraphPad Prism’
. R package version 1.0.5.
https://cran.r-project.org/package=ggprism doi: 10.5281/zenodo.4556067

  1. # BibTex for LaTeX users
  2. @Manual{
  3. title = {ggprism: A 'ggplot2' Extension Inspired by 'GraphPad Prism'},
  4. author = {Charlotte Dawson},
  5. year = {2024},
  6. note = {R package version 1.0.5},
  7. url = {https://cran.r-project.org/package=ggprism},
  8. doi = {10.5281/zenodo.4556067}
  9. }

More Examples

Recreates this
figure

from the GraphPad Prism website. See this
vignette

for the source code and step-by-step instructions.

Recreates Figure 2B from Matsushita & Nishimura
(2020)
, which was originally
created using GraphPad Prism. See this
vignette

for the source code and step-by-step instructions.