# Underrated CRAN Packages

**R on The Data Sandbox**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

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 default`rgl`

– functions for 3D interactive graphics`rgeos`

– a geometry package but is currently planned to be retired at the end of 2023 for the`sf`

package`zoo`

– a library to deal with time series`pkgdown`

– a library fro building blog website, I use blogdown`nloptr`

– a library for solving non-linear optimization problems`Hmisc`

– an assortment of different data analysis tools`lme4`

– for fitting linear and generalized linear mixed-effects models`RcppEigen`

– integration of the`eigen`

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()

**leave a comment**for the author, please follow the link and comment on their blog:

**R on The Data Sandbox**.

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.