Anna Gorald
Anna Gorald

Reputation: 131

Save forest plot produced with rmeta

I make forest plot with rmeta package. My problem is saving of produced plot as it does not show the whole figure.

My sample data:

Results
metabolite   expb   lower95 upper95  pvalue   se
a            1,02    0,98    1,04     0,05    0.01
b            1,03    0,99    1,05     0,06    0.02
c            1,05    1,02    1,10     0,08    0.03
...
number of metabolites is 70

I make forest plot as follows

library(rmeta)
d <- meta.summaries(results$expb, results$se, names = results$metabolite, method = c("fixed"), data = results)

tabletext <- cbind(c("95%", "Lower", results$lower95, NA, NA), c("C.I.", "Upper", results$upper95, NA, NA), c("", "P-value", results$pvalue, NA, round(d$summary, 2)))

m <- c(NA, NA, results$expb, NA, d$summary)
m <- round(m, digits = 2)
l <- c(NA, NA, results$lower95, NA, d$summary - d$se.summary * 1.96)
l <- round(l, digits = 2)
u <- c(NA, NA, results$upper95, NA, d$summary + d$se.summary * 1.96)
u <- round(u, digits = 2)

forestplot(tabletext, m, l, u, zero = 1, summary = c(TRUE, TRUE, rep(FALSE, 
8), TRUE), boxsize = 0.2,cex.axis=0.2)

However, it cuts produced plot when i save it. Could you please help me to solve an issue. Thank you for any tips. PS. you can find example plot in the following link. Example figure

Upvotes: 1

Views: 580

Answers (1)

Max Gordon
Max Gordon

Reputation: 5467

This is partly why I created the forestplot package. It is based on rmeta::foresplot so you should not have to change anything in your function call.

Upvotes: 1

Related Questions