Commit 7dd18180 authored by Petar Horki's avatar Petar Horki

feat: integer levels in SetDF b now start at 0(previously at 1); integerLevels...

feat: integer levels in SetDF b now start at 0(previously at 1); integerLevels parameter is now explicit boolean(previously only implicit).
parent ebd4a6a6
......@@ -486,7 +486,7 @@ Category.Equal <- function(catInA, catInB) {
#' (enabled by default)
#'
#' @export
SetDF <- function(dfIn, integerLevels = 1) {
SetDF <- function(dfIn, integerLevels = TRUE) {
myNames <- names(dfIn)
for (myNameIter in myNames) {
......@@ -499,7 +499,7 @@ SetDF <- function(dfIn, integerLevels = 1) {
Set(myDomain, 'isRepeatable', FALSE)
if(!is.null(levels(dfIn[[myNameIter]]))) {
if(1 == integerLevels) {
if(TRUE == integerLevels) {
myType <- "integer"
myLevels <- unique(levels(dfIn[[myNameIter]]))
......@@ -507,7 +507,7 @@ SetDF <- function(dfIn, integerLevels = 1) {
for (myOrderIter in 1:length(myLevels)) {
myLevelIter <- myLevels[myOrderIter]
Set(myDomain, 'Category', Category(Attribute(myLevelIter, 'label', 'en'), myOrderIter))
Set(myDomain, 'Category', Category(Attribute(myLevelIter, 'label', 'en'), myOrderIter-1))
}
} else {
myType <- typeof(levels(dfIn[[myNameIter]]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment