A function for graphical parameters of the shapes used in forestplot()
This function encapsulates all the non-text elements that are used in the
forestplot
function. As there are plenty of shapes
options this function gathers them all in one place.
fpShapesGp( default = NULL, box = NULL, lines = NULL, vertices = NULL, summary = NULL, zero = NULL, axes = NULL, hrz_lines = NULL, grid = NULL )
default |
A fallback |
box |
The graphical parameters ( |
lines |
The graphical parameters ( |
vertices |
The graphical parameters ( |
summary |
The graphical parameters ( |
zero |
The graphical parameters ( |
axes |
The graphical parameters ( |
hrz_lines |
The graphical parameters ( |
grid |
The graphical parameters ( |
This function obsoletes fpColors
.
If some, but not all parameters of a shape (e.g. box) are specified in gpar()
such as setting lwd but not line color, the unspecified parameters default
to the ones specified in default
, then, default to legacy parameters
of forestplot
such as col
.
Parameters box
, lines
, vertices
, summary
may be set as list
containing several gpars. The length of the list must either be equal to the number of bands
per label or to the number of bands multiplied by the number of labels, allowing specification
of different styles for different parts of the forest plot.
The parameter grid
can either be a single gpar or a list of gpars with as many
elements as there are lines in the grid (as set by the xticks
or grid
arguments of forestplot)
Parameters zero
, axes
, hrz_lines
must either be NULL or gpar
but cannot be lists of gpars.
list A list with the elements:
default |
the gpar for default attributes |
box |
the gpar or list of gpars of the box/marker |
lines |
the gpar or list of gpars of the lines |
vertices |
the gpar or list of gpars of the vertices |
summary |
the gpar or list of gpars of the summary |
zero |
the gpar of the zero vertical line |
axes |
the gpar of the x-axis |
hrz_lines |
the gpar of the horizontal lines |
grid |
the gpar or list of gpars of the grid lines |
Andre GILLIBERT
Other forestplot functions:
forestplot()
,
fpColors()
,
fpDrawNormalCI()
,
fpLegend()
ask <- par(ask = TRUE) # An example of how fpShapesGp works styles <- fpShapesGp( default = gpar(col = "pink", lwd = 2, lineend = "square", linejoin = "mitre"), grid = list( gpar(col = "blue"), gpar(col = "black"), gpar(col = "blue") ), box = list( gpar(fill = "black"), gpar(fill = "blue"), gpar(fill = "black"), gpar(fill = "blue") ), lines = gpar(lty = "dashed"), vertices = gpar(lwd = 5, col = "red") ) forestplot( labeltext = c("Author1", "Author2", "Author3", "Author4"), grid = c(1, 3, 5), mean = 1:4, lower = 0:3, upper = 2:5, shapes_gp = styles ) par(ask = ask)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.