title: Months appear in alphabetical order when animation created in R
body: <p>I am creating an animation in R. But when the animation renders it shows months in alphabetical order.
  It start from April, August and so on. It should start from January, February</p>
  <p>I havent found any satisfactory answer of this.</p>
  <pre><code>
  library(tidyverse)
  library(gganimate)
  
  ov_tidy &lt;- read_csv(&quot;ov_tidy.csv&quot;)
  
  ov_formatted &lt;- ov_tidy %&gt;%
    group_by(year) %&gt;%
    # The * 1 makes it possible to have non-integer ranks while sliding
    mutate(rank = rank(-value),
           Value_rel = value/value[rank==1],
           Value_lbl = paste0(&quot;$&quot;,format(value, scientific = FALSE))) %&gt;%
    group_by(country_name) %&gt;% 
    filter(rank &lt;=10) %&gt;%
    ungroup()
  
  # Animation
  
  
  anim &lt;- ggplot(ov_formatted, aes(rank, group = country_name, 
                                   fill = as.factor(country_name), color = as.factor(country_name))) +
    geom_tile(aes(y = value/2,
                  height = value,
                  width = 0.9), alpha = 0.8, color = NA) +
    geom_text(aes(y = 0, label = paste(country_name, &quot; &quot;)), vjust = 0.2, hjust = 1) +
    geom_text(aes(y=value,label = Value_lbl, hjust=0)) +
    coord_flip(clip = &quot;off&quot;, expand = FALSE) +
    scale_y_continuous(labels = scales::comma) +
    scale_x_reverse() +
    guides(color = FALSE, fill = FALSE) +
    theme(axis.line=element_blank(),
          axis.text.x=element_blank(),
          axis.text.y=element_blank(),
          axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.title.y=element_blank(),
          legend.position=&quot;none&quot;,
          panel.background=element_blank(),
          panel.border=element_blank(),
          panel.grid.major=element_blank(),
          panel.grid.minor=element_blank(),
          panel.grid.major.x = element_line( size=.1, color=&quot;grey&quot; ),
          panel.grid.minor.x = element_line( size=.1, color=&quot;grey&quot; ),
          plot.title=element_text(size=25, hjust=0.5, face=&quot;bold&quot;, colour=&quot;grey&quot;, vjust=-1),
          plot.subtitle=element_text(size=18, hjust=0.5, face=&quot;italic&quot;, color=&quot;grey&quot;),
          plot.caption =element_text(size=8, hjust=0.5, face=&quot;italic&quot;, color=&quot;grey&quot;),
          plot.background=element_blank(),
          plot.margin = margin(2,2, 2, 4, &quot;cm&quot;)) +
    transition_states(year, transition_length = 4, state_length = 1, wrap = FALSE) +
    view_follow(fixed_x = TRUE)  +
    labs(title = 'Funding data YTD : {closest_state}',  
         subtitle  =  &quot;Sub Heading&quot;,
         caption  = &quot;Caption... Outlier Ventures&quot;) 
  
  # For GIF
  
  animate(anim, 200, fps = 20,  width = 1200, height = 1000, 
          renderer = gifski_renderer(&quot;ov_funding_data.gif&quot;), end_pause = 15, start_pause =  15) 
  
  # For MP4
  
  animate(anim, 200, fps = 20,  width = 1200, height = 1000, 
          renderer = ffmpeg_renderer()) -&gt; for_mp4
  
  anim_save(&quot;ov_funding_data.mp4&quot;, animation = for_mp4 )
  
  
  </code></pre>
  <p>Any help in this regard will be highely appericiated</p>