Skip to content
Back to formatted view

Raw Message

Message-ID: <2d4284d5-ed39-8794-6dfe-7c87159c927c@imbi.uni-freiburg.de>
Date: 2020-12-17T18:40:09Z
From: Guido Schwarzer
Subject: [R-meta] Superscript in Forest plot (meta)
In-Reply-To: <trinity-4e747863-3446-4de8-aad0-ef4a22b984a8-1608220924231@3c-app-gmx-bap22>

Am 17.12.20 um 17:02 schrieb Tobias Saueressig:
> Dear Guido,
> that looks fantastic. This makes it even better! Thank you. For all 
> people that publish in the JAMA Network that is very helpful.

The following auxiliary R function could be handy in that case:

JAMAlabels <- function(author, year, reference) {
 ? res <- NA
 ? for (i in seq(along = author))
 ??? res[i] <-
 ????? as.expression(substitute(study^ref~(year),
 ?????????????????????????????? list(study = author[i],
 ??????????????????????????????????? ref = reference[i],
 ??????????????????????????????????? year = year[i])))
 ? ##
 ? res
}

refs <- 20 + seq_len(nrow(Fleiss1993bin))
##
mylabs <-
 ? JAMAlabels(Fleiss1993bin$study, Fleiss1993bin$year, refs)

I will probably add this function to R package meta with the next update.

BW Guido