Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't animate plot from ggstream #496

Open
RicardoRH96 opened this issue Mar 13, 2024 · 0 comments
Open

Can't animate plot from ggstream #496

RicardoRH96 opened this issue Mar 13, 2024 · 0 comments

Comments

@RicardoRH96
Copy link

I'm trying to animate a muller plot but I'm having errors when doing "transition_reveal(after_stat(x))"
Reproducible example:

df <- data.frame(year = seq(1980,2023,1),
group = rep(c('group1','group2'),22),
count = runif(44, min=0, max=150))

ggplot(df, aes(year, count, fill=group)) +
geom_stream(type="ridge", color = 1, lwd=0.3, alpha=0.9, sorting = "none") +
xlab("Year") +
ylab("Count") +
transition_reveal(after_stat(x))

This is the error I'm getting:
Error in geom_stream():
! Problem while computing stat.
ℹ Error occurred in the 1st layer.
Caused by error in dplyr::left_join():
! Join columns in y must be present in the
data.
✖ Problem with group.
Run rlang::last_trace() to see where the error occurred.
Warning messages:
1: In data.frame(x = full_values$x, y = yy[, iStream * 2], group = as.integer(.group)) :
NAs introduced by coercion
2: In data.frame(x = full_values$x, y = yy[, iStream * 2], group = as.integer(.group)) :
NAs introduced by coercion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant