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

Error in seq.default(range[1], range[2], length.out = nframes) #307

Closed
themichjam opened this issue Mar 14, 2019 · 12 comments
Closed

Error in seq.default(range[1], range[2], length.out = nframes) #307

themichjam opened this issue Mar 14, 2019 · 12 comments
Labels

Comments

@themichjam
Copy link

themichjam commented Mar 14, 2019

Been trying out package with own panel dataset. Keep running into this error

ntp <- ggplot(shes13141516i, aes(IllCode1, Heconac12, size = agecat, colour = Sex)) +
  geom_point(alpha = 0.7) +
  scale_colour_manual(values = country_colors) +
  scale_size(range = c(2, 12)) +
  scale_x_log10() +
  facet_wrap(~HBCode) +
  theme(legend.position = 'none') +
  labs(title = 'SYear: {frame_time}', x = 'IllCode1', y = 'Heconac12') +
  transition_time(year) +
  ease_aes('linear')

animate(p, 100, 10)

Produces:

Error in seq.default(range[1], range[2], length.out = nframes) : 
  'from' must be a finite number
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
@ghost
Copy link

ghost commented Mar 18, 2020

I've run into the exact same error

@pennybeaver
Copy link

I am also receiving the same error message.

gabo<-ggplot(data=Gabo, aes(x=Lon, y=Lat, colour=year)) +
geom_point(size=3) +
geom_polygon(data=world,aes(x=lon, y=lat,group = group), col="darkgrey") +
coord_quickmap()+
lims(x=c(100,180), y=c(-55,40))+

Here comes the gganimate specific bits

labs(title = 'Date: {frame_time}') +
transition_time(date) +
shadow_mark(alpha=0.2, size = 2)+
ease_aes('linear')

animate(gabo,nframes = 200, width=800, height=1000, renderer = gifski_renderer())

Error in seq.default(range[1], range[2], length.out = nframes) :
'from' must be a finite number

Have you solved this issue or is it still outstanding?

@thomasp85
Copy link
Owner

Can either of you provide a reproducible example ?

@pennybeaver
Copy link

pennybeaver commented Mar 18, 2021

Hi Thomas

Thank you for following this up, I worked it out with help from another coder Mike Sumner.

The error was fixed by adding %>% filter(!is.na(date))

Code below in full I can also share a rmarkdown html file if this helps?

ggplot(data=Year1 %>% filter(!is.na(date)), aes(x=Lon, y=Lat, col=colony)) +
	geom_point(size=3) +
  geom_polygon(data=world,aes(x=lon, y=lat,group = group), col="darkgrey") + 
  coord_quickmap()+
	lims(x=c(100,180), y=c(-50,40))+
  # Here comes the gganimate specific bits
  labs(title = "Date: {frame_time}", x = 'longitude', y ='lattitude') +
  transition_time(date) +
	shadow_mark(alpha=0.2, size = 2)+
  ease_aes('linear')

animate(pY1,nframes=200, width=800, height=1000, renderer = gifski_renderer())

@thomasp85
Copy link
Owner

if you can share your data it would help me debug it 🙂

@pennybeaver
Copy link

pennybeaver commented Mar 18, 2021 via email

@thomasp85 thomasp85 added the bug label Mar 18, 2021
@thomasp85
Copy link
Owner

Hi @pennybeaver — I do not have access to the data in the link. You may need to change the permissions somehow

@thomasp85
Copy link
Owner

Nevermind, I'm pretty sure I found the culprit. Can I get you to confirm that the error is gone in the development version?

@pennybeaver
Copy link

pennybeaver commented Mar 19, 2021 via email

@thomasp85
Copy link
Owner

Can you install the GitHub version remotes::install_github('thomasp85/gganimate') and check if the issue is gone?

@pennybeaver
Copy link

I have installed the GitHub version remotes::install_github('thomasp85/gganimate') do I just rerun the code, sorry I have not used remotes:: ?

@M-Colley
Copy link

I have installed the GitHub version remotes::install_github('thomasp85/gganimate') do I just rerun the code, sorry I have not used remotes:: ?

Yes, you now have the development version.

VolodiaPG pushed a commit to VolodiaPG/gganimate that referenced this issue May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants