Skip to content

Commit

Permalink
Fix bug when factor column didn't contain all levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmelville committed Aug 6, 2018
1 parent 3a63ace commit 99764db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/vizier.R
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ color_helper_column <- function(x,
# factor_to_colors(iris$Species, color_scheme = "Set3") # ColorBrewer palette
# factor_to_colors(iris$Species, color_scheme = rainbow) # color ramp function
factor_to_colors <- function(x, color_scheme = grDevices::rainbow) {
category_names <- unique(x)
category_names <- levels(x)
ncolors <- length(category_names)
color_palette = make_palette(ncolors = ncolors, color_scheme = color_scheme)
color_palette[x]
Expand Down

0 comments on commit 99764db

Please sign in to comment.