Closed MetaEntropy closed 4 years ago
Sounds like a great idea.
Awesome! All the updates are now in the develop-branch. Checking CRAN-compatibilty and will send update tomorrow.
If you have the time an update to the vignette would be nice. The example shows the concept, the vignette in turn is a little more inspirational of how to do proper plots, e.g. you could show your JAMA layout as a reference.
Current feature and limitation
The
col
parameter of theforestplot
function can be set to afpColors
object to customize colors of most non-text graphical elements of a forestplot.forestplot
has a few additionnal parameters such aslwd.ci
andlty.ci
. It does not allow full customization. For instance,linejoin
andlineend
cannot be customized for ci and summary elements without overridingfn.ci_norm
andfn.ci_sum
. To follow the style of forest plots of the Journal of American Medical Association (JAMA), I had to customize these two functions in order to set mitre/square linejoin/lineend and choose different border and fill colors for diamonds.Proposal
Provide a
shapes_gp
describing the same elements ascol
but with gpar() elements (liketxt_gp
) rather than just colors. Together,shapes_gp
andtxt_gp
should allow full customization of all graphical elements. When a parameter (e.g. line type of CI) is both defined inshapes_gp
and in the legacy parameter,shapes_gp
should take the precedence. Indeed, some of these legacy parameters have default values, and giving them precedence would make customization counter-intuitive since overridingshapes_gp
would not be enough. The interfaces offpDrawNormalCI
,fpDrawSummaryCI
,fpDrawCircleCI
should be kept compatible (keeping lwd, lty parameters) but the additionnalshapes_gp
parameter would be taken as parameter and used by these functions.Pull request
I am working on a pull request