Skip to content

Commit

Permalink
Improved RDS parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Dec 17, 2024
1 parent a613938 commit c6210e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pmml-rexp/src/main/java/org/jpmml/rexp/RExpParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c6210e6

Please sign in to comment.