davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
150 stars 8 forks source link

bug: where 7 or more colour values #880

Closed davidhodge931 closed 3 months ago

davidhodge931 commented 3 months ago
library(ggplot2)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(palmerpenguins)

set_blanket()
#> Error in set_blanket(): could not find function "set_blanket"

d <- diamonds |> 
  mutate(across(!where(is.numeric), as.character)) 

d |> distinct(color)
#> # A tibble: 7 × 1
#>   color
#>   <chr>
#> 1 E    
#> 2 I    
#> 3 J    
#> 4 H    
#> 5 F    
#> 6 G    
#> 7 D

d |> 
  gg_point(
    x = clarity,
    y = price,
    col = color,
    col_palette = RColorBrewer::brewer.pal(8, "Dark2"),
  )
#> Error in gg_point(d, x = clarity, y = price, col = color, col_palette = RColorBrewer::brewer.pal(8, : could not find function "gg_point"

Created on 2024-05-27 with reprex v2.1.0

davidhodge931 commented 3 months ago

Hack is to create internal jumble with lots of greys on the end