ggforestplot error: Error in assertAndRetrieveTidyValue(x, mean) : argument "x" is missing, with no default

使用ggforestplot绘制森林图时,有时候会报如标题所示的错误 实际上,这不一定是因为缺失参数,也有可能是因为加载了forestplot包,这两者的语法存在交叉,所以如果同时加载,就可能出现错误,...

使用ggforestplot绘制森林图时,有时候会报如标题所示的错误

实际上,这不一定是因为缺失参数,也有可能是因为加载了forestplot包,这两者的语法存在交叉,所以如果同时加载,就可能出现错误,如以下代码所演示的

library(forestplot)
library(ggforestplot)
library(tidyverse)
library(magrittr)

df_linear <-
  df_linear_associations %>%
  dplyr::arrange(name) %>%
  dplyr::filter(dplyr::row_number() <= 30)

# Forestplot
forestplot::forestplot(
  df = df_linear,
  estimate = beta,
  logodds = FALSE,
  colour = trait,
  xlab = "1-SD increment in cardiometabolic trait
  per 1-SD increment in biomarker concentration"
)
#> Error in assertAndRetrieveTidyValue(x, mean): argument "x" is missing, with no default
解决办法是取消加载forestplot包,清洁环境并重新运行代码
  • 发表于 2022-12-19 13:42
  • 阅读 ( 1172 )
  • 分类:R

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
xun
xun

电路元件工程师

66 篇文章

作家榜 »

  1. omicsgene 654 文章
  2. 安生水 325 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. 红橙子 78 文章
  6. CORNERSTONE 72 文章
  7. rzx 67 文章
  8. xun 66 文章