Skip to content

Commit

Permalink
fix for #85 but not #82
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiecek committed Dec 12, 2019
1 parent 3a74007 commit 04b8b21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/calculate_variable_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ calculate_variable_split <- function(data, variables = colnames(data), grid_poin
calculate_variable_split.default <- function(data, variables = colnames(data), grid_points = 101) {
variable_splits <- lapply(variables, function(var) {
selected_column <- data[,var]
# numeric?
if (is.numeric(selected_column)) {
probs <- seq(0, 1, length.out = grid_points)
unique(quantile(selected_column, probs = probs))
} else {
unique(selected_column)
# sort will change order of factors in a good way
sort(unique(selected_column))
}
})
names(variable_splits) <- variables
Expand Down

0 comments on commit 04b8b21

Please sign in to comment.