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!