pub(crate) fn validate_factor_levels( sexp: SEXP, expected: &[&str], ) -> Result<(), SexpError>
Validate that a factor has the expected levels.