R/is-dotProduct.R

Defines functions is_dotProduct is.DotProduct

is.DotProduct <- function(stat) {
  "StatDotProduct" %in% class(stat)
}

is_dotProduct <- function(plot, any = TRUE) {
  layers <- plot$layers
  if(length(layers) == 0) return(FALSE)
  dotProduct <- vapply(layers, function(layer) is.DotProduct(layer$stat), logical(1L))
  if(any) any(dotProduct) else all(dotProduct)
}

Try the ggmulti package in your browser

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

ggmulti documentation built on May 29, 2024, 11:20 a.m.