| forest_dims | R Documentation |
Extracts the exact width and height of a 'meta' forest plot from its internal grid layout. This is primarily used to determine the optimal dimensions for saving the forest plot to a file.
forest_dims(x, ..., units = "in")
units2inches(x, units = "in", dpi = 300)
inches2units(x, units = "in", dpi = 300)
x |
An object of class |
... |
Additional arguments passed on to the underlying forest plot
method (e.g., |
units |
Units of the returned 'width' and 'height'. One of
|
dpi |
Plot resolution. |
Rather than using guesswork or manual row counting, 'forest_dims()' captures the forest plot as a true graphics object and extracts the precise width and height directly from its underlying structure.
Because it mathematically measures the actual rendered components, it is highly robust. It works seamlessly with any forest plot configuration.
A named list with elements:
width |
Forest plot width. |
height |
Forest plot height. |
units |
Units of 'width' and 'height'. |
Nour Edin Darwish nouredindarwish@gmail.com
# Create a simple meta-analysis object
ma <- metagen(TE = c(0.5, 0.8, 0.3), seTE = c(0.2, 0.3, 0.15),
studlab = paste("Study", LETTERS[1:3]))
# Get dimensions in inches (default)
forest_dims(ma)
# Get dimensions in centimetres
forest_dims(ma, units = "cm")
# Forest plot with details on meta-analysis methods
forest_dims(ma, details = TRUE, units = "cm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.