R forestplot 不允许使用 is.summary 的 labeltext 中的表达式?
R forestplot does not allow expressions in labeltext with is.summary?
我正在使用 forestplot 并希望在我的列名称之一中使用上标。 forestplot 小插图中提供了这样的示例,我在下面复制了它(将列名称从 expression(beta)
更改为我想要的 expression(pseudo~R^2)
)。
data(HRQoL)
clrs <- fpColors(box="royalblue",line="darkblue", summary="royalblue")
tabletext <-
list(c(NA, rownames(HRQoL$Sweden)),
append(list(expression(pseudo~R^2)), sprintf("%.2f", HRQoL$Sweden[,"coef"])))
forestplot(tabletext,
rbind(rep(NA, 3),
HRQoL$Sweden),
col=clrs,
is.summary=c(TRUE,FALSE,FALSE,FALSE,FALSE),
xlab="EQ-5D index")
Click here for image
这很好用,尽管在我的情节中我想指定 is.summary
。但是,这样做会弄乱表达式的 position/alignment。
forestplot(tabletext,
rbind(rep(NA, 3),
HRQoL$Sweden),
col=clrs,
is.summary=c(TRUE,FALSE,FALSE,FALSE,FALSE),
xlab="EQ-5D index")
Click here for poorly-aligned image
有办法解决这个问题吗?我的 expression()
和 is.summary
也可以吗?
我之前对表达式定位有疑问,因此所有这些都居中。我已经在 dev-branch (v. 1.5.2) 中修复了这个问题,使用 devtools 进行安装:
devtools::install_github("gforge/forestplot", ref="develop")
我正在使用 forestplot 并希望在我的列名称之一中使用上标。 forestplot 小插图中提供了这样的示例,我在下面复制了它(将列名称从 expression(beta)
更改为我想要的 expression(pseudo~R^2)
)。
data(HRQoL)
clrs <- fpColors(box="royalblue",line="darkblue", summary="royalblue")
tabletext <-
list(c(NA, rownames(HRQoL$Sweden)),
append(list(expression(pseudo~R^2)), sprintf("%.2f", HRQoL$Sweden[,"coef"])))
forestplot(tabletext,
rbind(rep(NA, 3),
HRQoL$Sweden),
col=clrs,
is.summary=c(TRUE,FALSE,FALSE,FALSE,FALSE),
xlab="EQ-5D index")
Click here for image
这很好用,尽管在我的情节中我想指定 is.summary
。但是,这样做会弄乱表达式的 position/alignment。
forestplot(tabletext,
rbind(rep(NA, 3),
HRQoL$Sweden),
col=clrs,
is.summary=c(TRUE,FALSE,FALSE,FALSE,FALSE),
xlab="EQ-5D index")
Click here for poorly-aligned image
有办法解决这个问题吗?我的 expression()
和 is.summary
也可以吗?
我之前对表达式定位有疑问,因此所有这些都居中。我已经在 dev-branch (v. 1.5.2) 中修复了这个问题,使用 devtools 进行安装:
devtools::install_github("gforge/forestplot", ref="develop")