Tests if input can be safely converted to distance or to area values.

are_all_area_or_dist(input, error = FALSE)

are_all_dist(input, error = FALSE)

Arguments

input

Character vector. Elements must match the requirements of the SPATA2 area framework. See details for more information.

Value

Logical vector of the same length as input and/or an error if verbose is TRUE.

Note

Only returns TRUE if all values are valid distance inputs or all values are valid area inputs.

Examples

are_all_area_or_dist(c("2mm", "2cm", "3px", "4.5mm2")) # TRUE

are_all_area_or_dist(c("2mm", "2CCm", "3px", "4.5mm2")) # FALSE

are_all_area_or_dist(c("2mm", "2CCm", "3px", "4.5mm2"), error = T) # FALSE -> error