正如@Ilari Scheinin 所说的完全正确,当您加载forestplot 包并使用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
由reprex package (v2.0.1) 于 2022 年 7 月 26 日创建
确保卸载森林图!
未加载时的代码forestplot:
当我运行您的代码时,没有错误。也许尝试重新启动您的环境并清理并重试。这是可重现的代码:
library(ggforestplot)
library(tidyverse)
library(magrittr)
df_linear <-
df_linear_associations %>%
dplyr::arrange(name) %>%
dplyr::filter(dplyr::row_number() <= 30)
# 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"
)
由reprex package (v2.0.1) 于 2022 年 7 月 26 日创建