0

我想创建一个森林图,我必须将参考作为上标放在森林图中。

我已经尝试了几件事。

假设这在我的作者列表中的参考文献中

   aut<- c("a, 2018", "c, 2018", "v, 2018", "f, 2018", "f, 2017", 
            "f, 2015", "y, 2014","ya, 2014","y, 2014","j, 2013", "j, 2011",
            "j, 2011","h, 2011", "g, 2011","e, 2010","r, 2008","f, 2008",
            "gh, 2007","h, 2006","h, 2005","h, 2004","h, 2003",
            "h, 2002", "g, 2002","f, 2002","f, 2001","f, 2001", "208136/016, 2001", "208136/007, 2001",
            "f, 2000","f, 2000", "g, 1999","g, 1999", "g, 1998",
            "d , 1998","g, 1998","go, 1997","g, 1995","g, 1994",
            "r, 1991","r, 1989","r, 1988","r, 1987","r, 1983",
            "g, 1982","g, 1981","g, 1975","g, 1975")
    ref<-as.character(seq(1:48))

我尝试了以下方法:

aut2<-parse(text(paste(expression(aut,"^",ref))))

但我收到一个错误:

    Error in parse(text(paste(expression(aut, "^", number)))) : 
  'file' must be a character string or connection
In addition: Warning message:
In xy.coords(x, y, recycle = TRUE, setLab = FALSE) :
  NAs introduced by coercion

我也尝试过表达,但这也不起作用。

谁能帮我?

谢谢!

4

1 回答 1

0

所以我找到了一个解决方案。不是最漂亮的,但它可以解决问题,我没有心情去寻找优雅的东西。

aut<-list(expression("author,2011"^2,.. etc)

其中2是参考。

更重要的是找到将东西放在 forestplot 函数中所需的正确格式

我希望这也可以帮助其他人:)

于 2019-10-09T14:22:56.407 回答