traverse_path: All traverse paths of a sequence

all_traverse_pathsR Documentation

All traverse paths of a sequence

Description

All traverse paths of a sequence

Usage

all_traverse_paths(rules, p)

get_one_traverse_path(rules, p)

plot_traverse_paths(rules, p, type = c("all", "11|22", "12|21"))

Arguments

rules

An sfc_rules object.

p

An sfc_sequence sequence. p and rules should have the same universe base set. Please provide p as a small sequence because the total number of all traverse paths might be very huge.

type

If the value is "11|22", it highlights the paths only via 1-1/2-2 corners. If the value is "12|21", it highlights the paths only via 1-2/2-1 corners.

Details

Given an input sequence with rotations, all_traverse_paths() lists all combinations of expansion codes from the first letter to the last letter in p (i.e. all possible traverse paths).

get_one_traverse_path() returns one random traverse path.

Value

all_traverse_paths() returns a list of integer vectors.

get_one_traverse_path() returns an integer vector.

Examples

# expansion rules for the general 3x3 curves
p = SFC_RULES_3x3_COMBINED@rules$I[[3]]
get_one_traverse_path(SFC_RULES_3x3_COMBINED, p)
get_one_traverse_path(SFC_RULES_3x3_COMBINED, p)
get_one_traverse_path(SFC_RULES_3x3_COMBINED, p)
get_one_traverse_path(SFC_RULES_3x3_COMBINED, p)
# 
p = SFC_RULES_3x3_COMBINED@rules$I[[3]]
plot_traverse_paths(SFC_RULES_3x3_COMBINED, p)
plot_traverse_paths(SFC_RULES_3x3_COMBINED, p, type = "11|22")
plot_traverse_paths(SFC_RULES_3x3_COMBINED, p, type = "12|21")

# 2x2 curve
p = sfc_2x2("I", 11)
plot_traverse_paths(SFC_RULES_2x2, p)

# Peano curve
p = sfc_3x3_peano("I", 1)
plot_traverse_paths(SFC_RULES_3x3_PEANO, p)

# Meander curve
p = sfc_3x3_meander("I", 1)
plot_traverse_paths(SFC_RULES_3x3_MEANDER, p)

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