Skip to content

Commit

Permalink
ordered default for make_factor
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyclements committed Nov 10, 2020
1 parent 22bdb00 commit 51a1cb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions instat/static/InstatObject/R/stand_alone_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1539,11 +1539,11 @@ slope <- function(y, x) {

}

make_factor <- function(x, ordered = FALSE) {
make_factor <- function(x, levels = NULL, ordered = is.ordered(x)) {
if (is.factor(x) & !is.ordered(x)){
x <- x
} else if (is.numeric(x)){
x <- factor(x, ordered = ordered)
x <- factor(x, levels = NULL, ordered = ordered)
} else if (is.character(x) | is.ordered(x)){
x <- factor(x, levels = unique(x), ordered = ordered)
} else {
Expand Down

0 comments on commit 51a1cb2

Please sign in to comment.