0

I have created three animations using gganimate, from which I am trying to visualize the yearly trend of number of crimes in European countries. The three plots are in my git repo Euro_Crime_Analysis_R under 5th section "Visualizing the data". Links for datasets, actual data which I used & code (rmd file) are also in the same repo.

Question: How are the parameters transition_length and state_length in transition_states command controlling the animated output?

I tried multiple combinations of each parameter and which I have used in my repo were the ones which gave a smooth animation. (and also attached the output of other combinations in this question)

  1. Plotting each offence for each country in each year from 2008-2017: In this plot, the issue is the last frame where the animation stops, there are some blank chunks in some bars? What is causing that there?

  2. Plotting the total number of offences in order (top 10) for each year: In this plot, when I tried with transition_length = 10, state_length = 1, the last frame gets distorted like this plot2_distorted_o/p

  3. Plotting the total number of offences along with each type of offence in order (top 15) for each year: In this plot, for most parameter combinations I tried, the stacks in bars are transitioning with a lag and in last frame again everything is distorted. Outputs of combinations of transition_length, state_length are 10,20 & 1,3 respectively.

TobiO
  • 1,335
  • 1
  • 9
  • 24
  • 1
    To make it easier for people to help, can you please make your questions separate questions and provide the relevant processed data in the body of your question using `dput(YOUR_DATA)` to make it a minimal reproducible example? – Jon Spring Dec 29 '19 at 03:05
  • See also here https://stackoverflow.com/a/5963610/1842673 – TobiO Dec 29 '19 at 04:33

0 Answers0