layer-like {ggblend}R Documentation

ggplot2 layer-like objects

Description

For technical reasons related to how ggplot2 implements layers, there is no single class from which all valid ggplot2 layers and lists of layers inherit. Thus, ggblend operations supports a variety of "layer-like" objects, documented here (see Details).

Usage

is_layer_like(x)

as_layer_like(x)

## Default S3 method:
as_layer_like(x)

## S3 method for class 'LayerInstance'
as_layer_like(x)

## S3 method for class 'list'
as_layer_like(x)

## S3 method for class 'layer_list'
as_layer_like(x)

Arguments

x

A layer-like object. See Details.

Details

ggblend operations can be applied to several ggplot2::layer()-like objects, including:

Anywhere in ggblend where a function parameter is documented as being layer-like, it can be any of the above object types.

Value

For is_layer_like(), a logical: TRUE if x is layer-like, FALSE otherwise.

For as_layer_like(), a "LayerInstance" or a layer_list().

Functions

Examples

library(ggplot2)

is_layer_like(geom_line())
is_layer_like(list(geom_line()))
is_layer_like(list(geom_line(), scale_x_continuous()))
is_layer_like(list(geom_line(), "abc"))

[Package ggblend version 0.1.0 Index]