gforge / forestplot

Advanced forest plots in R using grid graphics
43 stars 15 forks source link

boxsize #18

Closed xdemonc closed 6 years ago

xdemonc commented 6 years ago

Hi, thank you for sharing your code. It is really helpful for drawing the forest plot. I am just wondering the argument "boxsize" embedded in the function "forestplot", the default value of the boxsize to present the precision of effect size. Could this boxsize be set to present the weighed (the sample size for corespondent study)?

gforge commented 6 years ago

Yes, this is a question for StackOverflow

krassowski commented 4 years ago

For reference, this question was asked here: https://stackoverflow.com/questions/55475747/forestplot-change-boxes-normal-size-maintaining-precision a year ago, however, it does not have an answer as for today. I guess that one could pass a vector to boxsize, though the documentation seems very vague on it.

gforge commented 4 years ago

Thanks, I've added an answer. It is rather trivial but I've also updated the vignette so that it is easier to find. Basically you just add a wrapper around the draw function:

forestplot(tabletext, 
           title = "0.5x",
           fn.ci_norm = function(size, ...) {
             fpDrawNormalCI(size = size * 0.5, ...)
           },
           rbind(HRQoL$Sweden),
           clip =c(-.1, Inf),
           col=clrs,
           xlab="EQ-5D index",
           new_page = FALSE)