Learn R Programming

cayleyR (version 0.2.1)

find_combination_in_states: Find a State in Reachable States Table

Description

Searches for a specific permutation state in a reachable states table and returns the first matching row with metadata.

Usage

find_combination_in_states(reachable_states_start, search_state)

Value

Data frame row with state and metadata columns, or NULL if not found

Arguments

reachable_states_start

Data frame with V-columns and metadata

search_state

Integer vector, the state to search for

Examples

Run this code
df <- data.frame(V1 = c(1, 2), V2 = c(2, 1), operation = c("1", "2"),
                 step = c(1, 2), combo_number = c(1, 1))
find_combination_in_states(df, c(2, 1))

Run the code above in your browser using DataLab