Learn R Programming

matchr (version 0.1.0)

is.variant: Check Enum Variant

Description

Test whether Enum is variant variant.

Usage

is.variant(x, variant, ...)

Arguments

x

object to be tested

variant

character string denoting variant to check.

...

objects passed to methods

Value

TRUE if x is enumerated type of variant variant, FALSE otherwise

Examples

Run this code
# NOT RUN {
HelloEnum <- Enum(
  "HelloEnum",
  Hello,
  World
)

# TRUE
is.variant(HelloEnum$Hello, "Hello")

# FALSE
is.variant(HelloEnum$Hello, "World")
# }

Run the code above in your browser using DataLab