sfc_expand_by_rules: Expand a sequence

sfc_expand_by_rules,sfc_rules,sfc_nxn-methodR Documentation

Expand a sequence

Description

Expand a sequence

Usage

## S4 method for signature 'sfc_rules,sfc_nxn'
sfc_expand_by_rules(p, seq, code = 1L, flip = FALSE, by = "Cpp")

## S4 method for signature 'sfc_rules,factor'
sfc_expand_by_rules(p, seq, code = 1L, flip = FALSE, by = "Cpp")

## S4 method for signature 'sfc_rules,character'
sfc_expand_by_rules(p, seq, code = 1L, flip = FALSE, by = "Cpp")

Arguments

p

An sfc_rules object.

seq

An sfc_nxn object or other objects.

code

The expansion code.

flip

For the Peano curve and the Meander curves, each unit can be flipped without affecting other parts in the curve. This argument controls whether to flip the unit. Since currently it only works on the Peano curve and the Meander curve, flip should be a logical vector of length one or with the same length as seq. Whether it flips horizontally, vertically or against the diagonal line is automatically choosen. The value of flip can also be a function which takes the current curve as the only argument.

by

Which implementation? Only for the testing purpose.

Value

If seq is an sfc_nxn object, the function also returns an "expanded" sfc_nxn object. Or else it returns an sfc_sequence object.

Examples

sfc_expand_by_rules(SFC_RULES_2x2, sfc_2x2("I"))

sfcurve documentation built on Sept. 14, 2024, 1:07 a.m.