diff --git a/R/todo.R b/R/todo.R index 6e4288da..50ec3509 100644 --- a/R/todo.R +++ b/R/todo.R @@ -1,22 +1,26 @@ -# When bug in cut_short_scale() is fixed (expected in scales 1.3.1), change default: adjust_y_axis(cut_short_scale = TRUE) - # work on check_pipeline() # enforce "sequence of funs", with warnings and errors +# tidyplot, add, adjust, split +# (render, save, theme, remove) can always be used # what happens when tidyplot functions are applied to a ggplot that is was NOT generated with tidyplot() +# include internal function check_tidyplot(gg) -> Error: no tidyplot, use tidyplot() function # make color schemes accessible -# make hex sticker + +## FOR LATER: +## ------------------------------------------------ + +# When bug in cut_short_scale() is fixed (expected in scales 1.3.1), change default: adjust_y_axis(cut_short_scale = TRUE) + +# allow options, e.g. with something like tp_options <- list() # rename adjust_labels() to adjust_variable() ? Not sure. # add easteregg: add_funkyness() -## BEYOND SCOPE: -## ------------------------------------------------ - # text_labels for pie, donut and barstack? It is complicated! # https://r-charts.com/part-whole/pie-chart-labels-outside-ggplot2/ diff --git a/README.Rmd b/README.Rmd index 9deffd4a..07178a73 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,30 +19,37 @@ knitr::opts_chunk$set( ) ``` -# tidyplots +# tidyplots tidyplots website -[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) -## Overview - -tidyplots is an opinionated plotting package that makes to it ridiculously simple to create ready-to-use plots for scientific papers. It works by gradually adding and adjusting plot components and provides full control over composition, style, and absolute sizes. tidyplots is powered by the pipe `%>%` and provides a clean and minimalist interface for commonly used scientific plotting routines. +tidyplots streamlines the creation of publication-ready plots for scientific papers, making it incredibly easy to incorporate and refine plot elements. It allows precise control over composition, style, and absolute sizes, while its utilization of the pipe `%>%` simplifies the construction of powerful plotting pipelines. ## Installation -You can install the development version of `tidyplots` from [GitHub](https://github.com/) with: - ``` r -# install.packages("devtools") -devtools::install_github("jbengler/tidyplots") +# install.packages("pak") +pak::pak("jbengler/tidyplots") ``` -## Example +## Usage + +This is a basic example which shows you how to create a simple plot. -This is a basic example which shows you how to solve a common problem: +```{r, eval=FALSE} +library(tidyplots) + +study %>% + tidyplot(x = treatment, y = score, color = treatment) %>% + add_mean_bar(alpha = 0.3) %>% + add_error() %>% + add_jitter() %>% + save_plot("my_plot.pdf") + +``` -```{r example} +```{r, echo=FALSE} library(tidyplots) study %>% @@ -53,6 +60,6 @@ study %>% ``` -## Learn more +## Documentation https://jbengler.github.io/tidyplots/ diff --git a/README.md b/README.md index 9df76d2a..44ee6293 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,27 @@ -# tidyplots +# tidyplots tidyplots website - -[![Lifecycle: -experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) -## Overview - -tidyplots is an opinionated plotting package that makes to it -ridiculously simple to create ready-to-use plots for scientific papers. -It works by gradually adding and adjusting plot components and provides -full control over composition, style, and absolute sizes. tidyplots is -powered by the pipe `%>%` and provides a clean and minimalist interface -for commonly used scientific plotting routines. +tidyplots streamlines the creation of publication-ready plots for +scientific papers, making it incredibly easy to incorporate and refine +plot elements. It allows precise control over composition, style, and +absolute sizes, while its utilization of the pipe `%>%` simplifies the +construction of powerful plotting pipelines. ## Installation -You can install the development version of `tidyplots` from -[GitHub](https://github.com/) with: - ``` r -# install.packages("devtools") -devtools::install_github("jbengler/tidyplots") +# install.packages("pak") +pak::pak("jbengler/tidyplots") ``` -## Example +## Usage -This is a basic example which shows you how to solve a common problem: +This is a basic example which shows you how to create a simple plot. ``` r library(tidyplots) @@ -39,11 +30,12 @@ study %>% tidyplot(x = treatment, y = score, color = treatment) %>% add_mean_bar(alpha = 0.3) %>% add_error() %>% - add_jitter() + add_jitter() %>% + save_plot("my_plot.pdf") ``` - + -## Learn more +## Documentation diff --git a/_pkgdown.yml b/_pkgdown.yml index 0522b511..27606a45 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -5,7 +5,7 @@ template: reference: - title: desc: > - To create a plot, you start with the `tidyplot()` function. Then you call `add_funs()`, `adjust_funs()`, `theme_funs()` and `remove_funs()`, preferably in that order. `split_plot()` must be last in this sequence and can only be followed by `save_plot()`. + To create a plot, you start with the `tidyplot()` function. Then you call `add_*()`, `adjust_*()`, `theme_*()` and `remove_*()` functions, preferably in that order. `split_plot()` must be last in this sequence and can only be followed by `save_plot()`. - title: Create - contents: - tidyplot @@ -72,7 +72,7 @@ reference: - starts_with("adjust_flip") - starts_with("adjust_annotation") - title: Themes - desc: Style the plot to your liking. + desc: Choose and modify a theme. - contents: - starts_with("theme") - starts_with("remove") diff --git a/man/adjust_x_axis.Rd b/man/adjust_x_axis.Rd index ece8a208..30bffa54 100644 --- a/man/adjust_x_axis.Rd +++ b/man/adjust_x_axis.Rd @@ -30,7 +30,7 @@ adjust_y_axis( padding_top = NULL, transformation = "identity", position = "left", - cut_short_scale = TRUE, + cut_short_scale = FALSE, force_y_continuous = FALSE, ... ) diff --git a/man/figures/README-example-1.png b/man/figures/README-example-1.png index 4e9cf594..d202de8d 100644 Binary files a/man/figures/README-example-1.png and b/man/figures/README-example-1.png differ diff --git a/man/figures/README-unnamed-chunk-2-1.png b/man/figures/README-unnamed-chunk-2-1.png new file mode 100644 index 00000000..950e8451 Binary files /dev/null and b/man/figures/README-unnamed-chunk-2-1.png differ diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png new file mode 100644 index 00000000..6797ebc8 Binary files /dev/null and b/man/figures/README-unnamed-chunk-3-1.png differ diff --git a/man/figures/logo.svg b/man/figures/logo.svg new file mode 100644 index 00000000..666dbc77 --- /dev/null +++ b/man/figures/logo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tidy + plots + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png new file mode 100644 index 00000000..d5fb6e6a Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png new file mode 100644 index 00000000..9a9d11cb Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png new file mode 100644 index 00000000..95b6f11e Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png new file mode 100644 index 00000000..934e93e4 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png new file mode 100644 index 00000000..53e0a309 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 00000000..723125e4 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png new file mode 100644 index 00000000..c3f45c80 Binary files /dev/null and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png new file mode 100644 index 00000000..2196fd55 Binary files /dev/null and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 00000000..99278b73 Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ diff --git a/tidyplots.svg b/tidyplots.svg new file mode 100644 index 00000000..666dbc77 --- /dev/null +++ b/tidyplots.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tidy + plots + + + + + + + + + + + + + + \ No newline at end of file