Sign in

Jan Broder Engler

@jbengler.de
3.3K followers 910 following 821 posts

Scientist and software developer. Creator of tidyplots.org and sepacode.app. Website jbengler.de.

PostsRepliesMedia
Jan Broder Engler @jbengler.de · 3h
This is how you can test selected comparisons in #tidyplots 📋 #rstats #dataviz #phd
library(tidyplots)

study |>
  tidyplot(x = treatment, y = score, color = treatment) |>
  add_mean_dash() |>
  add_sem_errorbar() |>
  add_data_points() |>
  add_test_pvalue(comparisons = list(c(1,3),c(2,4)))
010
Jan Broder Engler @jbengler.de · 29/09/2026
This is the anatomy of #tidyplots 🩻 They come in 50 x 50 mm, but can be resized to your linking using `adjust_size()` 🧰 #rstats #dataviz #phd
151
Jan Broder Engler @jbengler.de · 28/09/2026
This is how you can generate donut charts in #tidyplots 🍩 #rstats #dataviz #phd
library(tidyplots)

energy |>
  tidyplot(y = energy, color = energy_source) |>
  add_donut()
020
Jan Broder Engler @jbengler.de · 27/09/2026
Here are some #tidyplots use cases for data journalism 🔥 Complete with data and code 🚀 tidyplots.org/use-cases/#data-journ… #rstats #dataviz #phd
071
Jan Broder Engler @jbengler.de · 26/09/2026
This is how you can adjust colors in #tidyplots 🌈 #rstats #dataviz #phd
library(tidyplots)
library(patchwork)

p1 <- 
  energy |> 
  tidyplot(x = year, y = energy, color = energy_type) |> 
  add_barstack_absolute() |> 
  adjust_colors(colors_discrete_apple)

p2 <- p1 |> adjust_colors(colors_discrete_metro)

wrap_plots(p1, p2, ncol = 1)
000
Jan Broder Engler @jbengler.de · 25/09/2026
This is how you can adjust the plot size in #tidyplots 🔥 All measures are in mm. #rstats #dataviz #phd
library(tidyplots)

study |> 
  tidyplot(x = group, y = score, color = group) |> 
  add_median_bar(alpha = 0.3) |> 
  add_median_dash() |> 
  add_data_points_beeswarm(white_border = TRUE) |> 
  remove_x_axis_labels() |> 
  adjust_size(width = 20, height = 50)
030
Jan Broder Engler @jbengler.de · 24/09/2026
This is how you can add normal data ellipses in #tidyplots 🐣 #rstats #dataviz #phd
library(tidyplots)

pca |>
  tidyplot(x = pc1, y = pc2, color = group) |>
  add_data_points() |>
  add_ellipse()
141
Jan Broder Engler @jbengler.de · 23/09/2026
This is how you can generate lollipop charts in #tidyplots 🍭 #rstats #dataviz #phd
library(tidyplots)

spendings |> 
  tidyplot(x = amount, y = category, color = category) |> 
  add_sum_bar(width = 0.05) |> 
  add_sum_dot()
140
Jan Broder Engler @jbengler.de · 22/09/2026
This is how you can change the color scheme in #tidyplots 🌈 #rstats #dataviz #phd
library(tidyplots)

spendings |> 
  tidyplot(x = category, y = amount, color = category) |> 
  add_sum_bar() |> 
  adjust_x_axis(rotate_labels = TRUE) |> 
  sort_x_axis_levels() |> 
  adjust_colors(new_colors = colors_discrete_candy)
030
Jan Broder Engler @jbengler.de · 21/09/2026
Tidyplots offers a variety of continuous color schemes 🌈 Most of the continuous color schemes are adapted from Stéfan van der Walt and Nathaniel Smith (2015) and were designed to maximize accessibility for individuals with color vision deficiencies. #rstats #dataviz
061
Jan Broder Engler @jbengler.de · 20/09/2026
Tidyplots offers a variety of diverging color schemes 🌈 Diverging color schemes are great to represent data that diverges around a central midpoint, often a meaningful neutral value like zero, an average, or a baseline. #rstats #dataviz
061
Jan Broder Engler @jbengler.de · 19/09/2026
This is how you can add ggplot2 code to your #tidyplots 🔥 #rstats #dataviz #phd
050
Jan Broder Engler @jbengler.de · 18/09/2026
In case you ever wondered about the differences between magrittr pipe and base pipe 🤔 This table is taken from a great stackoverflow answer by @GeorgKindermann stackoverflow.com/questions/6763302… #rstats #dataviz #phd
1122
Jan Broder Engler @jbengler.de · 17/09/2026
This is how you can install a specific version of a package 🤓 In these cases 📦 pak.r-lib.org comes in very handy #rstats #dataviz #phd
library(pak)

# install the latest CRAN release
pak("tidyplots")

# install the development version
pak("jbengler/tidyplots")

# install a specific version
pak("jbengler/tidyplots@v0.0.1")

# install a specific commit
pak("jbengler/tidyplots@9f7294a")
060
Jan Broder Engler @jbengler.de · 16/09/2026
You can easily switch between magrittr pipe `%>%` and base pipe `|>` in the RStudio settings 🧰 #rstats #dataviz #phd
040
Jan Broder Engler @jbengler.de · 15/09/2026
This is how you can highlight a subset of the dataset in #tidyplots 🔥 jbengler.github.io/tidyplots/refere… #rstats #dataviz #phd
library(tidyplots)

animals |> 
  tidyplot(x = weight, y = size) |> 
  add_data_points() |> 
  add_data_points(data = max_rows(weight, n = 3),
                  color = "red", shape = 1, size = 3)
141
Jan Broder Engler @jbengler.de · 14/09/2026
This is how you can plot z-scores in #tidyplots heatmaps 🚀 This is especially useful when you want to focus on the dynamics within rows or columns. #rstats #dataviz #phd
030
Jan Broder Engler @jbengler.de · 13/09/2026
This is how you can use plotmath expressions in #tidyplots 🤓 jbengler.github.io/tidyplots/articl… #rstats #dataviz #phd
050
Jan Broder Engler @jbengler.de · 12/09/2026
This is how you can add the mean and standard deviation to summarize the raw data points in your #tidyplots 🤩 Alternatively, you can also display the median, standard error of the mean, 95% confidence interval, and more. #rstats #dataviz #phd
library(tidyplots)

climate |> 
  tidyplot(x = month, y = max_temperature) |> 
  add_data_points_beeswarm(alpha = 0.3, color = "grey") |> 
  add_mean_line(linewidth = 0.5) |> 
  add_sd_ribbon()
050
Jan Broder Engler @jbengler.de · 11/09/2026
This is how you can remove elements from #tidyplots 🔥 jbengler.github.io/tidyplots/refere… #rstats #dataviz #phd
library(tidyplots)

study |> 
  tidyplot(x = treatment, y = score, color = treatment) |> 
  add_mean_bar(alpha = 0.4) |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm() |> 
  remove_legend() |> 
  remove_x_axis_ticks() |> 
  remove_y_axis_title()
062
Jan Broder Engler @jbengler.de · 10/09/2026
These are the discrete color schemes in #tidyplots 🌈 The default scheme `colors_discrete_friendly` is inspired by Okabe and Ito (2008) and was designed to be accessible for individuals with color vision deficiencies. #rstats #dataviz #phd
0101
Jan Broder Engler @jbengler.de · 09/09/2026
This is the grammar for summary statistics in #tidyplots 🤩 You can mix and match as you like. #rstats #dataviz #phd
070
Jan Broder Engler @jbengler.de · 08/09/2026
This is how you can label selected data points in #tidyplots 🔥 In this case, we label the three animals with the highest weight using `max_rows()`. #rstats #dataviz #phd
library(tidyplots)

animals |> 
  tidyplot(x = weight, y = size) |> 
  add_data_points() |> 
  add_data_labels_repel(data = max_rows(weight, n = 3),
                        label = animal, color = "black")
030
Jan Broder Engler @jbengler.de · 07/09/2026
This is how you can define a custom style to reuse it across several #tidyplots 🤩 #rstats #dataviz #phd
library(tidyplots)

my_style <- function(x) {
  x |> 
  adjust_colors(colors_discrete_apple) |> 
  adjust_font(family = "mono", face = "bold") |> 
  remove_x_axis_ticks() |> 
  remove_y_axis_ticks()
}

energy_week |> 
  tidyplot(date, power, color = energy_source) |> 
  add_areastack_relative() |> 
  my_style()
031
Jan Broder Engler @jbengler.de · 06/09/2026
Too many vector shapes can slow down PDF performance. This is how you can selectively rasterize data points in #tidyplots 🪩 In this example, I used 100 DPI for demonstration purposes. In practice, you would typically use 300 DPI for better quality 😉 #rstats #dataviz #phd
library(tidyplots)

climate |> 
  tidyplot(x = month, y = max_temperature) |> 
  add_data_points_beeswarm(white_border = TRUE, rasterize = TRUE, rasterize_dpi = 100)
140
Jan Broder Engler @jbengler.de · 05/09/2026
When you execute a #tidyplots color scheme like `colors_continuous_viridis` in the Console, you will get a preview in the RStudio Viewer pane 🌈 Pro tip: You can highlight and copy individual hex codes directly from the Viewer pane. #rstats #dataviz #phd
050
Jan Broder Engler @jbengler.de · 04/09/2026
All key features at a glance – with the #tidyplots cheatsheet 🤩 tidyplots.org/cheatsheet #rstats #dataviz #phd
060
Jan Broder Engler @jbengler.de · 03/09/2026
This is how you can highlight data in #tidyplots 💡 #rstats #dataviz #phd
150
Jan Broder Engler @jbengler.de · 02/09/2026
This is how you can split a plot into multiple subplots using #tidyplots 🚀 #rstats #dataviz #phd
library(tidyplots)

gene_expression |> 
  head(n = 180) |> 
  tidyplot(x = group, y = expression, color = group) |> 
  add_mean_bar(alpha = 0.3) |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm(white_border = TRUE) |> 
  adjust_size(width = 25, height = 25) |> 
  split_plot(by = external_gene_name, ncol = 3, nrow = 3)
010
Jan Broder Engler @jbengler.de · 01/09/2026
This is how you can generate multipage PDFs in #tidyplots 🪼 #rstats #dataviz #phd
library(tidyplots)

gene_expression |> 
  tidyplot(x = group, y = expression, color = group) |> 
  add_violin() |> 
  add_data_points_beeswarm(white_border = TRUE) |> 
  adjust_size(width = 25, height = 25) |> 
  split_plot(by = external_gene_name, ncol = 3, nrow = 4) |> 
  save_plot("my_genes.pdf")
050
Jan Broder Engler @jbengler.de · 31/08/2026
This is how you can generate multiple PDF files at once in #tidyplots 🚀 #rstats #dataviz #phd
library(tidyplots)

gene_expression |> 
  tidyplot(x = group, y = expression, color = group) |> 
  add_violin() |> 
  add_data_points_beeswarm(white_border = TRUE) |> 
  split_plot(by = external_gene_name, ncol = 1, nrow = 1) |> 
  save_plot("my_genes.pdf", multiple_files = TRUE)
031
Jan Broder Engler @jbengler.de · 30/08/2026
You can save #tidyplots in multiple formats by piping through multiple rounds of `save_plot()` 🤩 #rstats #dataviz #phd
library(tidyplots)

study |> 
  tidyplot(x = group, y = score, color = dose) |> 
  add_mean_dash() |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm() |> 
  save_plot("my_plot.pdf") |> 
  save_plot("my_plot.png") |> 
  save_plot("my_plot.svg")
161
Jan Broder Engler @jbengler.de · 29/08/2026
This is how you can assign colors in #tidyplots 🌈 #rstats #dataviz #phd
library(tidyplots)

study |> 
  tidyplot(x = treatment, y = score, color = treatment) |> 
  add_violin() |> 
  add_data_points_beeswarm() |> 
  adjust_colors(new_colors = 
                  c("A" = "#5B8DFE",
                    "B" = "#DD227D",
                    "C" = "#FE5F00",
                    "D" = "#FFB109"))
080
Jan Broder Engler @jbengler.de · 29/08/2026
Here are some #tidyplots use cases for proportional data 🔥 Complete with data and code 🚀 tidyplots.org/use-cases/#proportion… #rstats #dataviz #phd
051
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 11/07/2026
Annotate gel image using #tidyplots See the code at: tidyplots-book.pages.dev/more-custom-... #stats #dataviz #phd
0145
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 24/07/2026
(Rasterize) correlation heatmap using #tidyplots See the code at: tidyplots-book.pages.dev/more-plots#r... #stats #dataviz #phd
031
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 28/07/2026
Dumbbell plot using #tidyplots See the code at: tidyplots-book.pages.dev/more-plots#d... #stats #dataviz #phd
031
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 31/07/2026
Histogram using #tidyplots See the code at: tidyplots-book.pages.dev/more-plots#h... #stats #dataviz #phd
031
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 10/08/2026
Add ggplot2 (extention) code (three more plots) using #tidyplots See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
062
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 12/08/2026
Save multiple PDFs by piping through (e.g. violin plot) using #tidyplots images ├── multiple-pdf-by-piping-1.pdf ├── multiple-pdf-by-piping-2.pdf ├── multiple-pdf-by-piping-3.pdf └── multiple-pdf-by-piping-4.pdf See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
4th image
021
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 13/08/2026
Save multiple PDFs at once (e.g. violin plot) using #tidyplots List the figure names saved: See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
10th pdf
031
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 17/08/2026
Rasterize data points (e.g. dot plot) selectively using #tidyplots See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
041
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 21/08/2026
Color alpha vs. saturation (e.g. bar plot) using #tidyplots See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
041
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 23/08/2026
Show minor ticks (e.g. bar plot) using #tidyplots See the code at: tidyplots-book.pages.dev/plots-and-sk... #stats #dataviz #phd
071
Reposted by Jan Broder Engler
Kang Wu @wukang.bsky.social · 25/08/2026
Consistent color order between the horizontal stacked bar and the legend using #tidyplots See the code at: tidyplots-book.pages.dev/more-plots#c... #stats #dataviz #phd
051
Jan Broder Engler @jbengler.de · 28/08/2026
This is how you can compare groups in #tidyplots 🦊 #rstats #dataviz #phd
library(tidyplots)

study |> 
  tidyplot(x = group, y = score, color = dose) |> 
  add_boxplot() |> 
  add_mean_dash() |> 
  add_test_asterisks()
000
Jan Broder Engler @jbengler.de · 26/08/2026
Here are some #tidyplots use cases for bioinformatics 🔥 Complete with data and code 🚀 tidyplots.org/use-cases/#bioinforma… #rstats #dataviz #phd
020
Jan Broder Engler @jbengler.de · 25/08/2026
This is how you can add sum values in #tidyplots 🤩 #rstats #dataviz #phd
library(tidyplots)

spendings |> 
  tidyplot(x = category, y = amount, color = category) |> 
  add_sum_bar(alpha = 0.2) |> 
  add_sum_dash() |> 
  add_sum_value(accuracy = 1, color = "black") |> 
  adjust_x_axis(rotate_labels = TRUE)
060
Jan Broder Engler @jbengler.de · 24/08/2026
This is how you can sort the x-axis in #tidyplots 🤩 #rstats #dataviz #phd
library(tidyplots)

spendings |> 
  tidyplot(x = category, y = amount, color = category) |> 
  add_sum_bar(alpha = 0.2) |> 
  add_sum_dash() |> 
  add_sum_value(accuracy = 1, color = "black") |> 
  adjust_x_axis(rotate_labels = TRUE) |> 
  sort_x_axis_levels()
030
Jan Broder Engler @jbengler.de · 23/08/2026
This is how you can do horizontal bars in #tidyplots 😉 #rstats #dataviz #phd
library(tidyplots)

spendings |> 
  tidyplot(x = amount, y = category, color = category) |> 
  add_sum_bar(alpha = 0.2) |> 
  add_sum_dash() |> 
  add_sum_value(accuracy = 1, color = "black") |> 
  sort_y_axis_levels() |> 
  remove_legend()
070