sfc_is_compatible: Whether two sfc_sequence objects are compatible

sfc_is_compatible,sfc_sequence,sfc_sequence-methodR Documentation

Whether two sfc_sequence objects are compatible

Description

Whether two sfc_sequence objects are compatible

Usage

## S4 method for signature 'sfc_sequence,sfc_sequence'
sfc_is_compatible(p1, p2, strict = TRUE)

## S4 method for signature 'sfc_sequence,sfc_rules'
sfc_is_compatible(p1, p2)

## S4 method for signature 'sfc_rules,sfc_sequence'
sfc_is_compatible(p1, p2)

Arguments

p1

An sfc_sequence object.

p2

An sfc_sequence object.

strict

TRUE or FALSE, see Details.

Details

The function compares whether the two universe base pattern sets are identical. If strict is TRUE, the order of the two universe sets should also be the same. If strict is FALSE, the universe set of p2 can be a subset of the universe set of p1.

Value

A logical scalar.

Examples

p1 = sfc_2x2("I")
p2 = sfc_2x2("R")
sfc_is_compatible(p1, p2)

p1 = sfc_2x2("I")
p2 = sfc_sequence("R")
sfc_is_compatible(p1, p2)
sfc_is_compatible(p1, p2, strict = FALSE)

p1 = sfc_sequence("ABC")
p2 = sfc_sequence("DEF")
sfc_is_compatible(p1, p2)

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