Last updated: 2022-03-16

Checks: 7 0

Knit directory: myTidyTuesday/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210907) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version df80a1d. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    catboost_info/
    Ignored:    data/2021-11-27glm_wf_final.rds
    Ignored:    data/CNHI_Excel_Chart.xlsx
    Ignored:    data/CommunityTreemap.jpeg
    Ignored:    data/Community_Roles.jpeg
    Ignored:    data/YammerDigitalDataScienceMembership.xlsx
    Ignored:    data/accountchurn.rds
    Ignored:    data/acs_poverty.rds
    Ignored:    data/advancedaccountchurn.rds
    Ignored:    data/airbnbcatboost.rds
    Ignored:    data/austinHomeValue.rds
    Ignored:    data/austinHomeValue2.rds
    Ignored:    data/australiaweather.rds
    Ignored:    data/baseballHRxgboost.rds
    Ignored:    data/baseballHRxgboost2.rds
    Ignored:    data/fmhpi.rds
    Ignored:    data/grainstocks.rds
    Ignored:    data/hike_data.rds
    Ignored:    data/nber_rs.rmd
    Ignored:    data/netflixTitles2.rds
    Ignored:    data/pets.rds
    Ignored:    data/pets2.rds
    Ignored:    data/spotifyxgboost.rds
    Ignored:    data/spotifyxgboostadvanced.rds
    Ignored:    data/us_states.rds
    Ignored:    data/us_states_hexgrid.geojson
    Ignored:    data/weatherstats_toronto_daily.csv

Untracked files:
    Untracked:  code/YammerReach.R
    Untracked:  code/googleCompute.R
    Untracked:  code/work list batch targets.R
    Untracked:  environment.yml

Unstaged changes:
    Deleted:    analysis/2022_02_11_tabular_playground.Rmd
    Modified:   code/_common.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/2022_03_14.Rmd) and HTML (docs/2022_03_14.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd df80a1d opus1993 2022-03-16 CRAN packages treemap with taller aspection ratio
html 102eb53 opus1993 2022-03-16 Build site.
Rmd 3ed6597 opus1993 2022-03-16 CRAN packages treemap filled by vignettes
Rmd b8ca143 opus1993 2022-03-16 CRAN packages treemap

This week’s dataset comes from Dr. Robert Flight and covers the evolution of the built in R package help documentation, often called Vignettes.

suppressPackageStartupMessages({
library(tidyverse) # clean and transform rectangular data
library(grumanlib) # my plot theme
library(treemapify)
})

source(here::here("code","_common.R"),
       verbose = FALSE,
       local = knitr::knit_global())

theme_set(grumanlib::theme_jim())

Load up the data to have a look

cran <- tidytuesdayR::tt_load("2022-03-15")$cran %>%
  mutate(
    MajorVersion = as.integer(str_extract(version, "^[0-9]\\.")),
    VignetteCount = as.integer(rmd + rnw),
    date = lubridate::parse_date_time(date,
      orders = c("Ymd HMS", "a b d HMS Y")
    ),
    package = str_to_lower(package),
    ReleaseYear = lubridate::year((lubridate::floor_date(date, "year")))
  ) %>%
  group_by(package, MajorVersion) %>%
  mutate(ReleaseType = case_when(
    row_number(date) == 1L ~ "Major",
    TRUE ~ "Minor"
  )) %>%
  ungroup()

    Downloading file 1 of 2: `cran.csv`
    Downloading file 2 of 2: `bioc.csv`
downloads <- cranlogs::cran_top_downloads("last-month", count = 100) %>%
  mutate(package = str_to_lower(package))
cran %>%
  count(ReleaseYear, ReleaseType) %>%
  filter(ReleaseYear > 2003) %>%
  ggplot(aes(x = ReleaseYear, n, fill = ReleaseType)) +
  geom_col() +
  labs(
    caption = "2021 is a partial year, ending August 12th",
    y = "Count of Releases published on CRAN"
  )

cran %>%
  arrange(package, date) %>%
  filter(!is.na(date)) %>%
  inner_join(downloads, by = "package") %>%
  group_by(package) %>%
  summarise(
    vignettes = last(VignetteCount),
    born_on = lubridate::year(min(date)),
    age = round(
      lubridate::interval(min(date), Sys.Date()) / lubridate::years(1), 1
    ),
    downloads = sum(count),
    .groups = "drop"
  ) %>%
  mutate(package = glue::glue("{ package } \n { vignettes }")) %>%
  ggplot(aes(
    area = downloads,
    fill = vignettes,
    label = package,
    subgroup = cut_interval(born_on, n = 4)
  )) +
  geom_treemap(show.legend = FALSE) +
  geom_treemap_subgroup_border() +
  geom_treemap_text(aes(color = after_scale(map_chr(fill, best_contrast))),
    place = "top",
    reflow = TRUE
  ) +
  geom_treemap_subgroup_text(
    color = "white",
    alpha = 0.2,
    place = "bottomleft",
    fontface = "italic",
    min.size = 0
  ) +
  labs(
    fill = NULL, title = "Top Most Downloaded R Packages from CRAN",
    subtitle = "Package Name and Number of Vignettes labeled. Size corresponds to the Total Number of Downloads.",
    caption = "Data Source: Robert Flight and cranlogs"
  ) +
  theme(legend.position = "none")


sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] treemapify_2.5.5     grumanlib_0.1.0.9999 forcats_0.5.1       
 [4] stringr_1.4.0        dplyr_1.0.8          purrr_0.3.4         
 [7] readr_2.1.2          tidyr_1.2.0          tibble_3.1.6        
[10] ggplot2_3.3.5        tidyverse_1.3.1      workflowr_1.7.0     

loaded via a namespace (and not attached):
  [1] readxl_1.3.1       backports_1.4.1    systemfonts_1.0.4 
  [4] workflows_0.2.4    selectr_0.4-2      plyr_1.8.6        
  [7] tidytuesdayR_1.0.2 splines_4.1.2      listenv_0.8.0     
 [10] usethis_2.1.5      digest_0.6.29      foreach_1.5.2     
 [13] htmltools_0.5.2    yardstick_0.0.9    viridis_0.6.2     
 [16] parsnip_0.2.0      fansi_1.0.2        magrittr_2.0.2    
 [19] memoise_2.0.1      tune_0.1.6         tzdb_0.2.0        
 [22] recipes_0.2.0      globals_0.14.0     ggfittext_0.9.1   
 [25] modelr_0.1.8       gower_1.0.0        vroom_1.5.7       
 [28] R.utils_2.11.0     hardhat_0.2.0      rsample_0.1.1     
 [31] dials_0.1.0        colorspace_2.0-3   rvest_1.0.2       
 [34] textshaping_0.3.6  haven_2.4.3        xfun_0.29         
 [37] prismatic_1.1.0    callr_3.7.0        crayon_1.5.0      
 [40] jsonlite_1.8.0     survival_3.2-13    iterators_1.0.14  
 [43] glue_1.6.2         gtable_0.3.0       ipred_0.9-12      
 [46] R.cache_0.15.0     future.apply_1.8.1 scales_1.1.1      
 [49] infer_1.0.0        DBI_1.1.2          Rcpp_1.0.8.2      
 [52] viridisLite_0.4.0  bit_4.0.4          GPfit_1.0-8       
 [55] lava_1.6.10        prodlim_2019.11.13 httr_1.4.2        
 [58] ellipsis_0.3.2     farver_2.1.0       pkgconfig_2.0.3   
 [61] R.methodsS3_1.8.1  nnet_7.3-16        sass_0.4.0        
 [64] dbplyr_2.1.1       utf8_1.2.2         here_1.0.1        
 [67] labeling_0.4.2     tidyselect_1.1.2   rlang_1.0.1       
 [70] DiceDesign_1.9     later_1.3.0        munsell_0.5.0     
 [73] cellranger_1.1.0   tools_4.1.2        cachem_1.0.6      
 [76] cli_3.2.0          generics_0.1.2     broom_0.7.12      
 [79] evaluate_0.15      fastmap_1.1.0      yaml_2.3.4        
 [82] ragg_1.2.2         bit64_4.0.5        processx_3.5.2    
 [85] knitr_1.37         fs_1.5.2           workflowsets_0.1.0
 [88] future_1.24.0      whisker_0.4        R.oo_1.24.0       
 [91] xml2_1.3.3         compiler_4.1.2     rstudioapi_0.13   
 [94] curl_4.3.2         cranlogs_2.1.1     reprex_2.0.1      
 [97] lhs_1.1.4          bslib_0.3.1        stringi_1.7.6     
[100] highr_0.9          ps_1.6.0           lattice_0.20-45   
[103] Matrix_1.3-4       styler_1.7.0       conflicted_1.1.0  
[106] vctrs_0.3.8        tidymodels_0.1.4   pillar_1.7.0      
[109] lifecycle_1.0.1    furrr_0.2.3        jquerylib_0.1.4   
[112] httpuv_1.6.5       R6_2.5.1           promises_1.2.0.1  
[115] gridExtra_2.3      parallelly_1.30.0  codetools_0.2-18  
[118] MASS_7.3-54        assertthat_0.2.1   rprojroot_2.0.2   
[121] withr_2.5.0        parallel_4.1.2     hms_1.1.1         
[124] grid_4.1.2         rpart_4.1-15       timeDate_3043.102 
[127] class_7.3-19       rmarkdown_2.13     git2r_0.29.0      
[130] getPass_0.2-2      pROC_1.18.0        lubridate_1.8.0   
LS0tDQp0aXRsZTogIlIgUGFja2FnZSBWaWduZXR0ZSBDb3VudHMiDQphdXRob3I6ICJKaW0gR3J1bWFuIg0KZGF0ZTogIk1hcmNoIDE0LCAyMDIyIg0Kb3V0cHV0Og0KICB3b3JrZmxvd3I6OndmbG93X2h0bWw6DQogICAgdG9jOiBubw0KICAgIGNvZGVfZm9sZGluZzogaGlkZQ0KICAgIGNvZGVfZG93bmxvYWQ6IHRydWUNCiAgICBkZl9wcmludDogcGFnZWQNCmVkaXRvcl9vcHRpb25zOg0KICBjaHVua19vdXRwdXRfdHlwZTogY29uc29sZQ0KLS0tDQoNClRoaXMgd2Vlayd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