pub(crate) fn factor_vec_from_sexp<T: RFactor>( sexp: SEXP, ) -> Result<Vec<T>, SexpError>
Convert an R factor SEXP to a Vec of enum values.