condGrob: Create a named grob or a template grob depending on a test
Description
Creates and returns a grid object using the function
given by `grobFun` when `test` is `TRUE` Otherwise a simple `grob()`
is produced with the same parameters. All grob parameters are given in `...`.
A grob as produced by either the `grobFun` given or by `grob()` using the remaining arguments.
If `test = FALSE` then the name is suffixed by ": `grobFun name` arguments".
Arguments
test
Either `TRUE` or `FALSE` to indicate whether `grobFun` is to be used (default `TRUE`) or not.
grobFun
The function to be used to create the grob when `test = TRUE` (e.g. `textGrob`, `polygonGrob`, etc.).
name
The name to be used for the returned grob.
...
The arguments to be given to the `grobFun` (or to `grob()` when `test = FALSE`).