Skip to content

Commit

Permalink
remove base:: and use nlevels
Browse files Browse the repository at this point in the history
Co-authored-by: Don van den Bergh <[email protected]>
  • Loading branch information
Kucharssim and vandenman authored Nov 29, 2023
1 parent c165fbb commit c951bc5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/regressionloglinearbayesian.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ RegressionLogLinearBayesianInternal <- function(jaspResults, dataset = NULL, opt
# So, we shift the first level to be the last level to keep the output consistent
for (fac in factors) {
var <- dataset[[fac]]
lev <- base::levels(var)
if (length(lev) > 1) {
newLev <- c(lev[2:length(lev)], lev[1])
dataset[[fac]] <- base::factor(var, levels = newLev)
if (nlevels(var) > 1) {
lev <- levels(var)
dataset[[fac]] <- factor(var, levels = c(lev[-1], lev[1]))
}
}
}
Expand Down

0 comments on commit c951bc5

Please sign in to comment.