<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/first-release-and-update-dates-of-r-packages-statistics/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://tomaztsql.wordpress.com/2018/10/07/first-release-and-update-dates-of-r-packages-statistics/"> R – TomazTsql</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>R has been around long time and the packages have evolved through the years as well. From the initial releases, updates, to new packages. Like many open-source and community driven languages, R is not an exception. And getting the first release dates of R packages requires little bit of web scrapping and lots of fun.</p>
<p><a rel="nofollow" href="https://cran.r-project.org/" target="_blank">CRAN – Comprehensive R Archive Network </a>– has invested a lot of people, rules and hours of work to have the packages available for general public in tidy, ready-to-use and easy-to-use fashion.</p>
<p> </p>
<h1>Last R Package updates</h1>
<p>First, let’s check the last package update dates. By loading rvest and getting the data from CRAN web site: <a rel="nofollow" href="https://cran.r-project.org/web/packages/available_packages_by_date.html" target="_blank">https://cran.r-project.org/web/packages/available_packages_by_date.html</a> we are able to turn the HTML table into usable data.frame in R.</p>
<pre>library(rvest)
library(ggplot2)

url = 'https://cran.r-project.org/web/packages/available_packages_by_date.html'

CRANpage &lt;- read_html(url)
tbls &lt;- html_nodes(CRANpage, &quot;table&quot;) # since HTML is in table; no need to scrape td/tr elements
table1 &lt;- html_table(tbls[1], fill = TRUE)
dd &lt;- data.frame(table1[1])

#house cleaning
dd$Date &lt;- as.Date(dd$Date)

### simple graph
ggplot(dd, aes(x=Date)) +
geom_dotplot(binwidth =12) + 
labs(x = &quot;Dates&quot;, y = &quot;Number of packages updates by Year of last update&quot;) +
scale_x_date(date_breaks= &quot;2 years&quot;, date_labels = &quot;%Y/%m&quot;, limits = as.Date(c(&quot;2005-01-01&quot;, &quot;2018-10-10&quot;)))</pre>
<p>Based on this graph, we can see that many of the R packages have been updated in past year or two.</p>
<p><img data-orig-file="https://tomaztsql.files.wordpress.com/2018/10/2018-10-07-18_49_23-plot-zoom.png?w=456" data-orig-size="716,513" data-medium-file="https://tomaztsql.files.wordpress.com/2018/10/2018-10-07-18_49_23-plot-zoom.png?w=456?w=300" data-attachment-id="5129" data-image-meta="{" data-image-description="" src="https://tomaztsql.files.wordpress.com/2018/10/2018-10-07-18_49_23-plot-zoom.png?w=456" data-permalink="https://tomaztsql.wordpress.com/2018/10/07/first-release-and-update-dates-of-r-packages-statistics/2018-10-07-18_49_23-plot-zoom/" data-large-file="https://tomaztsql.files.wordpress.com/2018/10/2018-10-07-18_49_23-plot-zoom.png?w=456?w=605" alt="2018-10-07 18_49_23-Plot Zoom" data-image-title="2018-10-07 18_49_23-Plot Zoom" sizes="(max-width: 605px) 100vw, 605px" data-comments-opened="1" class="wp-image-5129" data-recalc-dims="1"></p>
<p>So, how many? So we run the following statement:</p>
<pre>library(dplyr)
library(lubridate)

# updates by year
dd_y &lt;- dd %>%
mutate( PYear= year(Date)) %>%
select (PYear) %>%
group_by(PYear) %>%
summarise(
  nof = n()
)</pre>
<p>with the results:</p>
<pre><span># A tibble: 14 x 2</span>
   <span>PYear</span>   <span>nof</span>
<span> </span></pre>