R/S3-vpStack.R

Defines functions get_vp_from_vpStack vpStack_names

# It is not suggested
# it modifies the data structure of the grid graphics
# names.vpStack <- function(x) {
#   vapply(x,
#          function(v) {
#            v$name
#          }, character(1L))
# }
#
# `[.vpStack` <- function(x, i) {
#   x[[which(grepl(i, vpStack_names(x)))]]
# }

vpStack_names <- function(x) {
    vapply(x,
           function(v) {
             v$name
           }, character(1L))
}

get_vp_from_vpStack <- function(x, i) {
  x[[which(grepl(i, vpStack_names(x)))]]
}

Try the loon.shiny package in your browser

Any scripts or data that you put into this service are public.

loon.shiny documentation built on Oct. 8, 2022, 5:05 p.m.