davidsjoberg / ggstream

A package to make streamplots
Other
173 stars 15 forks source link

Can't normally run geom_stream_label #6

Closed bianchenhao closed 3 years ago

bianchenhao commented 3 years ago

I run the demo code below,

library(ggstream)
library(ggplot2)

ggplot(blockbusters, aes(year, box_office, fill = genre)) +
  geom_stream() +
  geom_stream_label(aes(label = genre))
# Warning message:
# Computation failed in `stat_stream_density_text()`:
# Problem with `summarise()` input `ymin`.
# x Column `xymin` not found in `.data`
# ℹ Input `ymin` is `max(.data$xymin)`. 

warning occurs, and the plot without label, image

SessionInfo

R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C               LC_TIME=zh_CN.UTF-8       
 [4] LC_COLLATE=zh_CN.UTF-8     LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8   
 [7] LC_PAPER=zh_CN.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.2       ggstream_0.0.0.9000

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13  magrittr_2.0.1   tidyselect_1.1.0 munsell_0.5.0    colorspace_2.0-0
 [6] R6_2.5.0         rlang_0.4.9      fansi_0.4.1      dplyr_1.0.2      tools_3.6.2     
[11] grid_3.6.2       packrat_0.5.0    gtable_0.3.0     cli_2.2.0        withr_2.3.0     
[16] ellipsis_0.3.1   digest_0.6.27    assertthat_0.2.1 tibble_3.0.4     lifecycle_0.2.0 
[21] crayon_1.3.4     farver_2.0.3     purrr_0.3.4      tidyr_1.1.2      vctrs_0.3.5     
[26] glue_1.4.2       labeling_0.4.2   compiler_3.6.2   pillar_1.4.7     generics_0.1.0  
[31] scales_1.1.1     pkgconfig_2.0.3 
davidsjoberg commented 3 years ago

Thank you! It was a typo in the code :) It's solved now.