trevorld / ggpattern

ggplot geoms with pattern fills
https://trevorldavis.com/R/ggpattern/dev/
Other
356 stars 18 forks source link

[BUG]Run the code of the emample but failed #109

Closed CarrieBishop closed 5 months ago

CarrieBishop commented 5 months ago

Bug description

I download "ggpattern" with the command remotes::install_github("coolbutuseless/ggpattern") ,and download the package successfully.But I run the code in example failed.

library("ggplot2")
library("ggpattern")
df <- data.frame(level = c("a", "b", "c", 'd'), outcome = c(2.3, 1.9, 3.2, 1))

ggplot(df) +
  geom_col_pattern(
    aes(level, outcome, pattern_fill = level), 
    pattern = 'stripe',
    fill    = 'white',
    colour  = 'black'
  ) +
  theme_bw(18) +
  theme(legend.position = 'none') + 
  labs(
    title    = "ggpattern::geom_col_pattern()",
    subtitle = "pattern = 'stripe'"
  ) +
  coord_fixed(ratio = 1/2)

Session info The output in RStudio are following: Error: when calculate 'units' in loadNamespace().onLoad failed,details: call: NULL error: no database found!

Can you tell me how to solve the problem?

trevorld commented 5 months ago