diff --git a/pmml-rexp/src/main/java/org/jpmml/rexp/RExpParser.java b/pmml-rexp/src/main/java/org/jpmml/rexp/RExpParser.java index bd5ef7b..39239b6 100644 --- a/pmml-rexp/src/main/java/org/jpmml/rexp/RExpParser.java +++ b/pmml-rexp/src/main/java/org/jpmml/rexp/RExpParser.java @@ -327,8 +327,12 @@ private RIntegerVector readIntVector(int flags) throws IOException { } RIntegerVector result = new RIntegerVector(values, readAttributes(flags)); - if(result.hasAttribute("levels")){ - result = new RFactorVector(values, result.getAttributes()); + if(result.hasAttribute("class")){ + RStringVector classNames = result._class(); + + if(classNames.indexOf("factor") > -1){ + result = new RFactorVector(values, result.getAttributes()); + } } return result;