
今天继续给大家推荐优秀的数据可视化工具-「spiro」
这个工具的用途比较简单,主要为为心肺运动测试数据提供了一个快速、标准化和可重复的工作流程。
它提供了数据导入、处理、汇总和数据可视化展示工具。这里我们重点介绍其数据可视化功能。
spiro包的数据可视化功能主要依赖其spiro_plot() 函数。下面就列举几个案例:
# \donttest{
# Import and process example data
ramp_data <- spiro(
file = spiro_example("zan_ramp"),
hr_file = spiro_example("hr_ramp.tcx")
)
# Display the traditional Wasserman 9-Panel Plot
spiro_plot(ramp_data)
# Display selected panels, here V-Slope
spiro_plot(ramp_data, which = 5)
# Modify the arrangement of plots by passing arguments to
# cowplot::plot_grid() via the grid_args argument
spiro_plot(ramp_data, which = c(4, 5, 6, 8), grid_args = list(nrow = 1))
# Modify the appearance of plots using the style_args argument
spiro_plot(ramp_data, style_args = list(size = 0.3, color_VCO2 = "black"))
# Modify the appearance of plots by passing arguments to ggplot2::theme() via
# the style_args argument
spiro_plot(ramp_data,
style_args = list(axis.title.x = ggplot2::element_text(colour = "green"))
)
# }

spiro_plot(ramp_data, which = 5)

spiro_plot(ramp_data, which = c(4, 5, 6, 8), grid_args = list(nrow = 1))

spiro_plot(ramp_data, style_args = list(size = 0.3, color_VCO2 = "black"))

spiro_plot(ramp_data,
style_args = list(axis.title.x = ggplot2::element_text(colour = "green"))
)

更多关于spiro包的语法和可视化案例,感兴趣的同学可阅读spiro包官网[1]