## TODO #### 1. charger le dataset `us_city_populations` de la librairie `vizoR` #### 2. tracer un line chart de l'évolution de la population des villes US #### 3. Mettez en évidence les 5 plus grandes villes (hint: package gghighlight) [introduction gghighlight](https://cran.r-project.org/web/packages/gghighlight/vignettes/gghighlight.html) #### 4. Appliquez les principes de design de Tufte ##### 5. BONUS: affichez le nom des villes directement à la fin de la ligne #### 6. Réalisez un streamgraph des 5 plus grandes villes US (hint: package ggTimeSeries) --- ## TODO 2 #### Trouver une 3e visualization pertinente pour montrer l'évolution de la population des villes US. --- ```r data("us_city_populations") n_cities = 5 # top_cities <- # us_city_populations %>% # filter(Rank <= n_cities) %>% # select(City, State, Region) %>% # distinct() # # to_plot <- filter(us_city_populations, City %in% top_cities$City) #to_plot <- us_city_populations last_ranks <- us_city_populations %>% filter(Year == max(Year)) %>% mutate(last_rank = Rank) %>% select(City, last_rank) to_plot <- left_join(us_city_populations, last_ranks, by= 'City') right_axis <- to_plot %>% group_by(City) %>% top_n(1, Year) %>% ungroup() %>% top_n(n_cities, -last_rank) ends <- right_axis %>% pull(Population) labels <- right_axis %>% pull(City) ``` --- class: full ![](lab7-temporal_data_files/figure-html/unnamed-chunk-2-1.png)<!-- --> --- class: full ![](lab7-temporal_data_files/figure-html/unnamed-chunk-3-1.png)<!-- --> --- ![](bar_race.gif)