Skip to contents

Distinguishes, where possible, a genuinely non-numeric element (R's `as.numeric()` raises "NAs introduced by coercion") from an explicit missing value already encoded in the data (e.g. an "NA" token, which `as.numeric()` parses cleanly to NA with no warning).

Usage

parse_dist_values(str, split, side)

Arguments

str

character scalar, e.g. "1:2:3"

split

separator, treated as a **literal string** and never as a regular expression (default ":")

side

label used in the error message ("x" or "y")

Value

numeric vector parsed from `str`; stops with an error instead of returning NA-containing output.