Underrated CRAN Packages
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I sit here looking for inspiration, nothing interesting to write about. Perhaps there are some popular R packages on CRAN that I don’t know about? You can explore the data on downloads from CRAN with the cranlogs
package.
Top CRAN downloads
With the following code we can get the most popular packages from CRAN. The CRAN directory doesn’t represent all R packages but a good amount of them.
library(tidyverse) library(cranlogs) top100 <- cran_top_downloads(when = 'last-month', count = 100) top100 %>% head() ## rank package count from to ## 1 1 ggplot2 2344057 2022-03-04 2022-04-02 ## 2 2 rlang 2239228 2022-03-04 2022-04-02 ## 3 3 glue 1800420 2022-03-04 2022-04-02 ## 4 4 sf 1704701 2022-03-04 2022-04-02 ## 5 5 cli 1665769 2022-03-04 2022-04-02 ## 6 6 dplyr 1665023 2022-03-04 2022-04-02
From this list, we can see that the tidyverse
represents a large amount of the top downloads with ggplot2
, rlang
and dplyr
. The list includes the sf
package for geo-spacial data, the glue
package for string manipulation and the cli
package which is used to create a command line interface for packages. Most of these packages I already have a good understanding of, so I need to narrow down the search.
Packages installed
You can get a list of your installed packages with the installed_packages function. You can than filter the top 100 list and remove anything you already have installed to find new packages.
mine <- installed.packages() %>% data.frame() %>% select(Package) new <- top100 %>% filter(!package %in% mine$Package) new ## rank package count from to ## 1 17 ragg 1161019 2022-03-04 2022-04-02 ## 2 21 rgl 1148721 2022-03-04 2022-04-02 ## 3 23 rgeos 1128166 2022-03-04 2022-04-02 ## 4 38 zoo 832762 2022-03-04 2022-04-02 ## 5 48 pkgdown 766019 2022-03-04 2022-04-02 ## 6 81 nloptr 565042 2022-03-04 2022-04-02 ## 7 88 Hmisc 542890 2022-03-04 2022-04-02 ## 8 89 lme4 538878 2022-03-04 2022-04-02 ## 9 93 RcppEigen 513045 2022-03-04 2022-04-02
From some quick research, I have found the following about the new packages:
ragg
– a 2D library as an alternative to the RStudio defaultrgl
– functions for 3D interactive graphicsrgeos
– a geometry package but is currently planned to be retired at the end of 2023 for thesf
packagezoo
– a library to deal with time seriespkgdown
– a library fro building blog website, I use blogdownnloptr
– a library for solving non-linear optimization problemsHmisc
– an assortment of different data analysis toolslme4
– for fitting linear and generalized linear mixed-effects modelsRcppEigen
– integration of theeigen
library in R for linear algebra
Take-away
Hopefully your take-way is a simple method to explore R library that you have never heard about. I know that a few of the libraries seem interesting and worth further exploring.
While we are at it, might as well find the daily values for the new packages and plot them for the last month.
new$package %>% cran_downloads(when = "last-month") %>% ggplot(aes(x = date, y = count, color = package)) + geom_line()
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.