geom_null | R Documentation |
The null geom can be used to silence graphic output from a stat, such as
stat_debug_group()
and stat_debug_panel()
defined in this same
package. No visible graphical output is returned. An invisible
grid::grid_null()
grob is returned instead.
geom_null(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
na.rm = FALSE,
show.legend = FALSE,
inherit.aes = TRUE,
...
)
mapping |
Set of aesthetic mappings created by
|
data |
A data frame. If specified, overrides the default data frame defined at the top level of the plot. |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to
|
A plot layer instance. Mainly used for the side-effect of printing
to the console the data
object.
This geom is very unusual in that it does not produce visible graphic
output. It only returns a grid.null
grob (graphical
object). However, it accepts for consistency all the same parameters as
normal geoms, which have no effect on the graphical output, except for
show.legend
.
ggplot(mtcars) +
geom_null()
ggplot(mtcars, aes(cyl, mpg)) +
geom_null()
# shape data
if (requireNamespace("sf", quietly = TRUE)) {
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot(data = nc) +
geom_null()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.