Skip to contents

This function extracts the class from the first row of a given worms_records tibble. If the tibble is empty, it returns NA.

Usage

extract_class(record)

Arguments

record

A tibble containing worms_records with at least a 'class' column.

Value

A character string representing the class of the first row in the tibble, or NA if the tibble is empty.

Examples

# Example usage:
record <- tibble::tibble(class = c("Class1", "Class2"))
iRfcb:::extract_class(record)
#> [1] "Class1"

empty_record <- tibble::tibble(class = character(0))
iRfcb:::extract_class(empty_record)
#> [1] NA