This class is used to validate phenology data.

Value

a list with lenient and strict validation

Public fields

LENIENT_PATTERN

Regular expression patterns for lenient validation

STRUCT

Regular expression patterns for strict validation'

PATTERNS

Regular expression patterns for validating individual fields

ACCEPTABLE_CODES

Data frame of acceptable phenology codes and species

PREVIOUS_SPECIES

List of previously observed species

missing_species

List of species that were found in data but are not in the acceptable codes

Methods


Method new()

Regular expression patterns for strict validation

Regular expression patterns for strict validation

Regular expression patterns for validating individual fields

Data frame of acceptable phenology codes and species

List of previously observed species

Initialize the PhenologyValidator class

Usage

PhenologyValidator$new(
  csv_path =
    "descriptions/Nuolja Master Documents/Accepted_PhenoCodes_Species_CURRENT.csv"
)

Arguments

csv_path

Path to the CSV file containing acceptable phenology codes and species

Returns

None


Method validate()

Validate a line of phenology data

Usage

PhenologyValidator$validate(line)

Arguments

line

A string representing a line of phenology data

Returns

A list with lenient validation results and field-wise validation


Method validateField()

List of species that were found in data but are not in the acceptable codes

Validate individual fields in a line of phenology data

Usage

PhenologyValidator$validateField(strLine)

Arguments

strLine

A string representing a line of phenology data

Returns

A list indicating the validity of each field


Method clone()

The objects of this class are cloneable with this method.

Usage

PhenologyValidator$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

phenology_validator <- PhenologyValidator$new()
#> Warning: cannot open file 'descriptions/Nuolja Master Documents/Accepted_PhenoCodes_Species_CURRENT.csv': No such file or directory
#> Error in file(file, "rt"): cannot open the connection
phenology_validator$validate("species, date, subplot, code")
#> Error in eval(expr, envir, enclos): object 'phenology_validator' not found