Skip to content

Commit e812b94

Browse files
committed
fix: enforce haven to read spss missings properly #3829
1 parent 75a8e0f commit e812b94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opal-r/src/main/java/org/obiba/opal/r/datasource/RAssignDatasource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ private void writeVariableAttributes(Variable variable) {
359359
attributesList.add(String.format("na_values = c(%s)",
360360
Joiner.on(", ").join(getLabelledCategories(variable, missingCats))));
361361
}
362+
// obiba/opal#3829 enforce haven to read spss missings properly
363+
attributesWriter.println(String.format("class(`%s`[['%s']]) <- c('haven_labelled_spss', class(`%s`[['%s']]))",
364+
getSymbol(tableName), variable.getName(), getSymbol(tableName), variable.getName()));
362365
}
363366
labels = String.format("c(%s)", Joiner.on(", ").join(getLabelledCategories(variable, variable.getCategories())));
364367
}

0 commit comments

Comments
 (0)