1

I have a data set in excel with 3 columns: Date, Index and MetroArea. I am trying to do an animated plot and this is the code I wrote. The error I get bakc says:

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"

ggplot(housing_data, 
       aes(x=MetroArea, y=Index, label = MetroArea, color = MetroArea)) +
  geom_point(stat = 'identity', size = 10) +
  geom_segment(aes(y=100, x=MetroArea, yend=Index, xend=MetroArea)) +
  geom_text(color="black", size=3) +
  coord_flip() +
  theme(legend.position = "none") +
  labs(title = "Date: {frame_time}", x='Date', y ='Index') +
  transition_time(date) +
  ease_aes('linear')

Can someone please help me make progress?

Thank you!

massisenergy
  • 1,764
  • 3
  • 14
  • 25
Messi10
  • 37
  • 1
  • 3
  • 2
    Please take a look at [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), to modify your question, with a smaller sample taken from your data (check `?dput()`). Posting images of your data or no data makes it difficult to impossible for us to help you! – massisenergy Mar 13 '20 at 15:28
  • Hi @massisenergy. When you have a moment, would you mind taking a look at my related question here? Thanks! »»» https://stackoverflow.com/questions/62030888/gganimate-ggplot2-error-when-using-transition-time-after-transforming-dataset – owlstone May 26 '20 at 20:32

0 Answers0