英文:
Changing decimal in forest plot to midline decimal
问题
在使用meta-package中的forest()函数创建的森林图中,我需要将报告的估计值和置信区间的小数点从普通小数点(例如,27.3)更改为中线小数点(例如,27·3)。
是否有任何方法?
我没有在RDocumentation或互联网上找到有关中线格式的信息。关于metafor-package的类似问题自2014年以来一直没有答案:https://stat.ethz.ch/pipermail/r-help/2014-July/376390.html
英文:
In my forest plot conducted with the forest()-function in the meta-package, I need to change the decimal points of the reported estimates and confidence intervals from normal decimal points (e.g., 27.3) into midline decimal points (e.g., 27·3).
Is there any way?
I did not find any information on midline formattting in the RDocumentation or the internet. A similar question for the metafor-package remained unanswered since 2014: https://stat.ethz.ch/pipermail/r-help/2014-July/376390.html
答案1
得分: 0
这个链接实际上有很多回复(请看这里)。正如我当时建议的,可以使用 options(OutDec=<>)
。当时我建议使用 options(OutDec="\xB7")
,但这可能不起作用。相反,您可以尝试直接指定一个中间的小数符号,如 options(OutDec="·")
。在我的机器上运行以下代码完全没有问题:
data(Olkin1995)
m1 <- metabin(ev.exp, n.exp, ev.cont, n.cont,
data = Olkin1995, subset = c(41, 47, 51, 59),
sm = "RR", method = "I",
studlab = paste(author, year))
options(OutDec="·")
forest(m1)
我在Windows和Linux下进行了测试。
英文:
The thread you linked to actually has a bunch of responses (see here). As I suggested back then, using options(OutDec=<>)
can work. Back then, I suggested using options(OutDec="\xB7")
but this may not work. Instead, you could try directly specifying a midline decimal symbol with options(OutDec="·")
. Running the following code on my machine works just fine:
data(Olkin1995)
m1 <- metabin(ev.exp, n.exp, ev.cont, n.cont,
data = Olkin1995, subset = c(41, 47, 51, 59),
sm = "RR", method = "I",
studlab = paste(author, year))
options(OutDec="·")
forest(m1)
I tested this under Windows and Linux.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论