Closed JanionNevill closed 8 months ago
This is what the addpoly()
function is for. See an example here:
https://wviechtb.github.io/metafor/reference/addpoly.rma.html#examples
This is more flexible, as one can add any number of polygons.
Will check into the issue with olim
.
That's much cleaner and more flexible, thanks. Am I right in thinking that I need to use ylim
to make the plot area fit the additional polygon?
Yes, that is correct, so there is an additional 'manual' step. But I would say that is a small inconvenience for the extra flexibility. This actually just made me think that it would be nice if one could also only specify a single value for ylim
which is then used for the lower bound, while the upper bound is still set automatically (since that one depends on k
, so one has to do a bit of thinking to choose an appropriate value). I just added this. So then one only has to do ylim=-1.5-<number of additional polygons to be added>
. And now olim
is applied correctly - thanks for catching that.
That's great, thanks. Do you have a schedule for when the changes will make it to CRAN?
Don't know. But you can always install the 'devel' version.
This was requested by a collaborator on a recent project, and I am keen to keep using the CRAN package, rather than relying on a fork which is not likely to be maintained.
The change is to allow for a second summary estimate to be plotted below the main summary estimate in the function
forest.rma()
. This allows for fixed and random effects to be shown on the same plot. I hope that this is something which fits with the ethos of this package.I updated the documentation for the function, but I may not have done a complete job because I have not worked on an R package before this.
I also noticed a small bug where the limits were not being applied to the summary estimate diamonds properly, so I have fixed that by limiting the
beta
variable rather than thepred
variable.I'm happy to make any changes which would make this change compatible with {metafor}.