gganimate
gganimate copied to clipboard
transition_time not working with stat_density2d
I have the following dataframe df1:
id_data X Y date
1 56581743344 -748130. -1052485. 2019-12-01
2 56581743344 -748130. -1052485. 2019-12-02
3 56581743344 -748130. -1052485. 2019-12-03
4 56581743344 -748130. -1052485. 2019-12-04
5 56581743344 -748130. -1052485. 2019-12-05
6 56331826114 -748045. -1053710. 2019-12-05
I tried to animate kernel 2d density using this code: ggplot(data= df1, aes(x = X, y = Y)) + stat_density2d(aes(fill = ..level..), alpha = .2, size = 1, bins = 5, geom = "polygon") + transition_time(date)
However, it returns the following error: Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "function"
Can I get you to provide a reprex and I'd be happy to look into it