corybrunson / ggalluvial

ggplot2 extension for alluvial plots
http://corybrunson.github.io/ggalluvial/
GNU General Public License v3.0
499 stars 34 forks source link

lode.guidance functions changed value - vignette outdated #46

Closed hannes101 closed 4 years ago

hannes101 commented 4 years ago

Description of the issue

Thanks for the package, the plots are really nice. I just found a small issue in the vignette. I was using the vignette on CRAN (https://cran.r-project.org/web/packages/ggalluvial/vignettes/ggalluvial.html) to get to know the package and adapt my data to the needs of the package. There appears that somehow the value for the lode.guidance option of geom_flow changed. Because when you want to execute the plot

data(majors)
majors$curriculum <- as.factor(majors$curriculum)
ggplot(majors,
       aes(x = semester, stratum = curriculum, alluvium = student,
           fill = curriculum, label = curriculum)) +
  scale_fill_brewer(type = "qual", palette = "Set2") +
  geom_flow(stat = "alluvium", lode.guidance = "frontback",
            color = "darkgray") +
  geom_stratum() +
  theme(legend.position = "bottom") +
  ggtitle("student curricula across several semesters")

It fails with a warning:

Warning message:
Computation failed in `stat_alluvium()`:
object 'lode_frontback' not found 

I think this is because the values changed to the ones, currently described in help("lode-guidance-functions").

corybrunson commented 4 years ago

Hi @hannes101, thanks a lot for raising the issue.

The reason for the issue is that v0.10.0 introduced alternate names for some of the lode guidance functions. See the news file for details. The vignette you linked to on CRAN is pretty recent (last month), so it uses these updated names. Could you check the version number of your ggalluvial installation? If it is before v0.10.0, then an update should synchronize you with the CRAN vignette. (I re-installed from CRAN just now and was able to reproduce the figure as in the vignette.)

Strangely, the GitHub CRAN mirror is still at v0.9.1 and so does not reflect the changes from v0.10.0. I'm not sure why this is, and perhaps it's unrelated, but i noticed it while examining the issue.

Please comment again if this doesn't resolve things! If it does, please let me know by closing the issue. : )

hannes101 commented 4 years ago

Ok, that's then caused by the outdated version here in my corporate environment, which I can't update. Thanks for the really quick reply and sorry for not checking the versions properly.

corybrunson commented 4 years ago

Not a problem. The news file also shows which old names correspond to which new ones, in case it's not clear from the documentation. Take care.