動機付けの例 - シンボル用に塗りつぶされた円と塗りつぶされていない円を含むフォレストプロットを作成する必要があります。
forestplot(labeltext = labelstrings,
fn.ci_norm = c(fpDrawCircleCI, fpDrawPointCI),
mean=cbind(df.both$mauc, df.both$mcmax),
lower=cbind(df.both$lauc, df.both$lcmax),
upper=cbind(df.both$uauc, df.both$ucmax),
xlog=TRUE,
boxsize=0.4,
pch=1,
xticks = c(0.33,0.5,0.8,1,1.25,2,3),
col=fpColors(box=c("black","black"),line=c("black","black")),
txt_gp = fpTxtGp(xlab=gpar(cex=1),ticks=gpar(cex=0.8)))`
ただし、シンボルのサイズはわずかに異なります (fpDrawPointCI は fpDrawCircleCI よりも小さい)。fpDrawPointCI を試してみると、受け入れられる pch 値のベクトルを取得できません。
私は試した
fn.ci_norm = c(fpDrawPointCI(pch=1), fpDrawPointCI(pch=19)
しかし、それはうまくいきませんでした。
それで、ライブラリ(forestplot)をロードした後、私のforestplotコマンドの前に、スクリプトでこれを作成しようとしました。
fpDrawPointCIfilled <- function (lower_limit, estimate, upper_limit, size,
y.offset = 0.5, clr.line, clr.marker, lwd, lty = 1, vertices,
vertices.height = 0.1, pch = 16, ...)
{
prFpDrawLine(lower_limit = lower_limit, upper_limit = upper_limit,
clr.line = clr.line, lwd = lwd, lty = lty, y.offset = y.offset,
vertices = vertices, vertices.height = vertices.height)
box <- convertX(unit(estimate, "native"), "npc", valueOnly = TRUE)
if (box >= 0 && box <= 1) {
if (!is.unit(size)) {
size <- unit(size, "snpc")
}
grid.points(x = unit(estimate, "native"), y = unit(y.offset,
"npc"), size = size, pch = pch, gp = gpar(fill = clr.marker,
col = clr.marker))
}}
fpDrawPointCIfilled() のエラー: 関数 prFpDrawLine が見つかりませんでしたというエラーが返されます。forestplot で fpDrawNormalCI 関数をどのように変更したかの例を投稿できますか?
ありがとう、クリス