whichInGrob: Return indices of layers of interest from the grob object

View source: R/addons.R

whichInGrobR Documentation

Return indices of layers of interest from the grob object

Description

The function matches the supplied vector of grob's layer names to the grob object and returns the indices of those layer names.

Usage

whichInGrob(grob, layer)

Arguments

grob

grob

layer

character vector

Details

If the layer doesn't exist the function returns NA.

Value

numeric vector

Author(s)

Małgorzata Oleś <malgorzata.oles@embl.de>

Examples

library("ggplot2")
gg = ggplotGrob(qplot(1,1))
whichInGrob(gg, "xlab-b")
whichInGrob(gg, c("xlab-b","panel"))

MalgorzataOles/BloodCancerMultiOmics2017 documentation built on March 29, 2024, 2:29 p.m.