[R-meta] [metafor package] How to use italics on one section of a forest plot

Alexandre Palaoro @lex@ndre@p@l@oro @ending from gm@il@com
Tue Jun 12 19:38:47 CEST 2018


Dear All,
I want to make a forest plot with subgroups using the forest() function of the
'metafor' package.
My code and potential plot is much similar to the one provided in the metafor
doku page
(http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups), but
with one simple difference:
The "Author(s) and Year" column (figure below) is going to be replaced by a list
of species names, and instead of a plain font, I want all species names to be in
italics. In my code, I plotted the species names using the 'slab' argument, as
the code below shows.
forest(res.rma.mv,xlim=c(-10,9),ylim=c(3,108), ilab=ilab.text, 
ilab.xpos=c(-6,-4.5,-3),       slab=expression(italic(data$species.name)),
       pch=21,bg=alpha("black",0.75),efac=0.2,cex=1)
I tried using the expression(italic()) function (and all its variants), but I
always get the same error, regardless of which argument I use ('slab' or
'ilab').
Error in forest.rma(res.rma.mv, xlim = c(-10, 9), ylim = c(3,108), ilab =
expression(italic(random$sp)), : Number of outcomes does not correspond to the
length of the 'ilab' argument. In addition: Warning message: In is.na(ilab) : 
is.na() applied to non-(list or vector) of type 'expression'
Does any one know how to work around this?
Best wishes,Alexandre

--Alexandre Varaschin Palaoro, Dr.LAGE do Departamento de EcologiaUniversidade
de São Paulo, Brazilhttp://alexandrevpalaoro.eco.br
Blog Sobrevivendo na Ciênciahttps://marcoarmello.wordpress.com/
	[[alternative HTML version deleted]]



More information about the R-sig-meta-analysis mailing list