forestplot
forestplot copied to clipboard
Text/Label & Title Positions
Apologies in advance if this should be two separate issues.
Would it be possible to add a method to position the title centrally over wherever the plot is displayed? Here a couple of examples I have produced but, at the moment, the text directly over the plot is hard coded (position-wise) using grid.text:
And also:

Similarly, would it be possible to add a way to label the bottom axis? Here is another forest plot (from a previous issue I have raised) but I am have to hard code the positions of both bits of text (Favour X and Favours Y):

Please let me know if you need anything further from me.
Sure, this is possible but I may have to put it on ice for now as I don't have the time if you want to tinker then the title is create here - you need to pride the new center positions.
The text options would probably be easiest to add here. Shouldn't be that difficult.
I'll be happy to help out with this but I must confess I am very new to package development/making updates.
I tried looking at the part of the code where the title is created but it seems to reference an internally defined function prGridPlotTitle (unless I am missing something?).
If someone could nudge me in the right direction I'd be happy to try to make this tweak. Same goes for Issue #12.
Neat. I try encapsulate as much as I can into functions that I call "private" as they aren't exported into the general namespace (they're available usin ::: e.g. forestplot:::prGridPlotTitle). They should all be located in the R/private.R file.
Fixing up someone else's package is an excellent learning exercise and good way to start before making your own package. It's also greatly appreciated :-)
Do the following (some details may be off but this is the gist of it):
- Install Git on your computer + install the R package devtools
- Fork the package into your own user
- Clone the package (use RStudio, create a new project and choose existing Git repo)
- Try the changes your interested in and in R studio you can directly load them by pressing "Ctrl+L"
- Once you're happy you commit your changes (you can do this in RStudio's top right window)
- Push the changes to Github (just press push)
- Log onto your Github account, go into your Fork of the package and do a "Pull Request"
Thanks!
Fixed in version 3.0