【R包】tidyplots----取代ggplot2的科研绘图利器

文章目录

介绍

tidyplots----取代ggplot2的科研绘图利器。tidyplots的目标是简化为科学论文准备出版的情节的创建。它允许使用一致和直观的语法逐渐添加,删除和调整情节组件。

安装

You can install the released version of tidyplots from CRAN with:

r 复制代码
install.packages("tidyplots")

And the development version from GitHub with:

r 复制代码
# install.packages("devtools")
devtools::install_github("jbengler/tidyplots")

Usage

Here are some examples. Also have a look at the getting started guide and the full documentation.

r 复制代码
library(tidyplots)

study |> 
  tidyplot(x = treatment, y = score, color = treatment) |> 
  add_mean_bar(alpha = 0.4) |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm()
r 复制代码
energy |> 
  tidyplot(x = year, y = energy, color = energy_source) |> 
  add_barstack_absolute()
r 复制代码
energy |> 
  dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |> 
  tidyplot(y = energy, color = energy_source) |> 
  add_donut() |> 
  split_plot(by = year)
r 复制代码
energy_week |> 
  tidyplot(x = date, y = power, color = energy_source) |> 
  add_areastack_absolute()
r 复制代码
energy_week |> 
  tidyplot(x = date, y = power, color = energy_source) |> 
  add_areastack_relative()
r 复制代码
study |> 
  tidyplot(x = group, y = score, color = dose) |> 
  add_mean_bar(alpha = 0.4) |> 
  add_mean_dash() |> 
  add_mean_value()
r 复制代码
time_course |>
  tidyplot(x = day, y = score, color = treatment) |>
  add_mean_line() |>
  add_mean_dot() |>
  add_sem_ribbon()
r 复制代码
climate |>
  tidyplot(x = month, y = year, color = max_temperature) |>
  add_heatmap()
r 复制代码
study |> 
  tidyplot(x = treatment, y = score, color = treatment) |> 
  add_boxplot() |> 
  add_test_pvalue(ref.group = 1)
r 复制代码
gene_expression |> 
  dplyr::filter(external_gene_name %in% c("Apol6", "Col5a3", "Vgf", "Bsn")) |> 
  tidyplot(x = condition, y = expression, color = sample_type) |> 
  add_mean_dash() |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm() |> 
  add_test_asterisks(hide_info = TRUE) |> 
  remove_x_axis_title() |> 
  split_plot(by = external_gene_name)
r 复制代码
study |> 
  tidyplot(x = treatment, y = score, color = treatment) |> 
  add_mean_bar(alpha = 0.4) |> 
  add_sem_errorbar() |> 
  add_data_points_beeswarm() |> 
  view_plot(title = "Default color scheme: 'friendly'") |> 
  adjust_colors(colors_discrete_apple) |> 
  view_plot(title = "Alternative color scheme: 'apple'")

文档

参考

相关推荐
FIT2CLOUD飞致云16 小时前
在线地图交互优化,查询组件选项值支持过滤条件,DataEase开源BI工具v2.10.19 LTS版本发布
开源·数据可视化·dataease·bi·数据大屏
kuankeTech1 天前
解决内外贸双轨制难题,外贸ERP智能引擎同步管理国内外合规与标准
大数据·人工智能·数据可视化·软件开发·erp
余醉 | dtminer2 天前
R语言常见新手问题
开发语言·r语言
佳哥的技术分享2 天前
Function<T, R> 中 apply,compose, andThen 方法总结
java·学习·r语言
isNotNullX3 天前
什么是数字脱敏?一文讲透数字脱敏概念
大数据·数据安全·数据可视化·数字脱敏
2501_942191773 天前
纺织品微观缺陷检测与分类:基于Faster R-CNN的改进模型实现与性能优化_1
分类·r语言·cnn
TDengine (老段)3 天前
TDengine R 语言连接器进阶指南
大数据·开发语言·数据库·r语言·时序数据库·tdengine·涛思数据
Katecat996633 天前
肾衰竭医学影像多类别目标检测:基于Mask R-CNN的囊肿、肾脏、结石和肿瘤六类病变特征识别_1
目标检测·r语言·cnn
2501_942191774 天前
使用Faster R-CNN实现网球球检测:基于R50-FPN-MS-3x模型的COCO数据集训练与优化
目标跟踪·r语言·cnn
2501_941329724 天前
长豆荚目标检测:Faster R-CNN改进模型实战与优化
目标检测·r语言·cnn