4  Merge tidyverse gallery and cran page packages

Read in and merge the data on ggplot packages from the gallery and from the cran webpage to store in a new dataframe, packages.

library(tidyverse)

gallery_packages <- read_csv("generated_data/gallery_packages.csv")

cran_packages <- read_csv("generated_data/cran_packages.csv")

packages <- full_join(gallery_packages, cran_packages, by = c("package", "downloads"))

Sort by download count and save.

sorted_packages <- arrange(packages, desc(downloads))

head(sorted_packages)
# A tibble: 6 × 6
  package  downloads stars gallery description                             CRAN 
  <chr>        <dbl> <dbl> <lgl>   <chr>                                   <lgl>
1 ggplot2  161360751    NA NA      Create Elegant Data Visualisations Usi… TRUE 
2 ggrepel   23721925  1228 TRUE    Automatically Position Non-Overlapping… TRUE 
3 cowplot   18374554   712 TRUE    Streamlined Plot Theme and Plot Annota… TRUE 
4 ggpubr    16464411  1154 TRUE    'ggplot2' Based Publication Ready Plots TRUE 
5 ggsci     12252560   676 TRUE    Scientific Journal and Sci-Fi Themed C… TRUE 
6 ggsignif  12184717   597 TRUE    Significance Brackets for 'ggplot2'     TRUE 
write_csv(sorted_packages, "generated_data/all_packages.csv")