operation_product {ggblend}R Documentation

Layer operation products

Description

operations can be multiplied together to form chains of operations, which when multiplied by (applied to) layer-like objects, return modified layer-like objects.

Usage

## S4 method for signature 'operation,ANY'
e1 * e2

## S4 method for signature 'ANY,operation'
e1 * e2

## S4 method for signature 'adjust,adjust'
e1 * e2

## S4 method for signature 'nop,nop'
e1 * e2

## S4 method for signature 'operation,nop'
e1 * e2

## S4 method for signature 'operation_sum,nop'
e1 * e2

## S4 method for signature 'nop,operation'
e1 * e2

## S4 method for signature 'nop,operation_sum'
e1 * e2

## S4 method for signature 'operation'
prod(x, ..., na.rm = FALSE)

## S4 method for signature 'operation,operation'
e1 * e2

## S4 method for signature 'numeric,operation'
e1 * e2

## S4 method for signature 'operation,numeric'
e1 * e2

## S4 method for signature 'operation,operation_sum'
e1 * e2

## S4 method for signature 'operation_sum,operation'
e1 * e2

## S4 method for signature 'operation_sum,operation_sum'
e1 * e2

Arguments

e1

an operation, layer-like, or numeric()

e2

an operation, layer-like, or numeric()

x, ...

operations

na.rm

ignored

Details

Multiplication of ggblend operations depends on the types of objects being multiplied:

Value

An operation.

Examples

library(ggplot2)

# multiplying operations by numerics repeats them...
adjust(color = "red") * 2

# multiplying operations together chains (or merges) them
adjust(color = "red") * adjust(linewidth = 2)

# multiplication obeys the distributive law
op = (adjust(aes(y = 11 -x), color = "skyblue") + 1) * (adjust(color = "white", linewidth = 4) + 1)
op

# multiplication by a geom returns a modified version of that geom
data.frame(x = 1:10) |>
  ggplot(aes(x = x, y = x)) +
  geom_line(linewidth = 2) * op


[Package ggblend version 0.1.0 Index]