pub fn factor_from_sexp<T: RFactor>(sexp: SEXP) -> Result<T, SexpError>
Convert an R factor SEXP to a single enum value.