Closed SymbolixAU closed 4 years ago
something like this / is it worth it?
print_values <- function(x, ... ) { m <- colourvalues::colour_values_rgb(x, ...) ## copied from crayon:::ansi256_rgb_index v <- 16 + rowSums(floor(6 * m[,1:3] / 256 ) * matrix(c(36,6,1), ncol = 3, nrow = nrow(m), byrow = T)) + 1 cat(paste0("\033[48;5;",v, 'm',x,"\033[39m")) } df <- data.frame( x = round( rnorm(500), 2 ) ) print_values( df$x, palette = "inferno" )
maybe call it colourvalues::show_coloured_values ?, or preview_colours()
colourvalues::show_coloured_values
preview_colours()
and why is this wrong?
print_values( sort( df$x ), palette = "sequential_hcl" )
I don't think this adds anything, other than bloat.
something like this / is it worth it?
maybe call it
colourvalues::show_coloured_values
?, orpreview_colours()
and why is this wrong?