<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/exploring-r-packages-with-cranly/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://rviews.rstudio.com/2018/05/31/exploring-r-packages/"> R Views</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p> 

<br>
<br>
<br>
<br>
<br>
<br>
</p>
<p>In a <a rel="nofollow" href="https://rviews.rstudio.com/2018/03/08/cran-package-metadata/" target="_blank">previous post</a>, I showed a very simple example of using the R function <code>tools::CRAN_package_db()</code> to analyze information about CRAN packages. <code>CRAN_package_db()</code> extracts the metadata CRAN stores on all of its 12,000 plus packages and arranges it into a “database”, actually a complicated data frame in which some columns have vectors or lists as entries.</p>
<p>It’s simple to run the function and it doesn’t take very long on my Mac Book Air.</p>
<pre><code>p_db &lt;- tools::CRAN_package_db()</code></pre>
<p>The following gives some insight into what’s contained in the data frame.</p>
<pre><code>dim(p_db)</code></pre>
<pre><code>## [1] 12635    65</code></pre>
<pre><code>matrix(names(p_db),ncol=2)</code></pre>
<pre><code>##       [,1]                      [,2]                 
##  [1,] &quot;Package&quot;                 &quot;Collate.windows&quot;    
##  [2,] &quot;Version&quot;                 &quot;Contact&quot;            
##  [3,] &quot;Priority&quot;                &quot;Copyright&quot;          
##  [4,] &quot;Depends&quot;                 &quot;Date&quot;               
##  [5,] &quot;Imports&quot;                 &quot;Description&quot;        
##  [6,] &quot;LinkingTo&quot;               &quot;Encoding&quot;           
##  [7,] &quot;Suggests&quot;                &quot;KeepSource&quot;         
##  [8,] &quot;Enhances&quot;                &quot;Language&quot;           
##  [9,] &quot;License&quot;                 &quot;LazyData&quot;           
## [10,] &quot;License_is_FOSS&quot;         &quot;LazyDataCompression&quot;
## [11,] &quot;License_restricts_use&quot;   &quot;LazyLoad&quot;           
## [12,] &quot;OS_type&quot;                 &quot;MailingList&quot;        
## [13,] &quot;Archs&quot;                   &quot;Maintainer&quot;         
## [14,] &quot;MD5sum&quot;                  &quot;Note&quot;               
## [15,] &quot;NeedsCompilation&quot;        &quot;Packaged&quot;           
## [16,] &quot;Additional_repositories&quot; &quot;RdMacros&quot;           
## [17,] &quot;Author&quot;                  &quot;SysDataCompression&quot; 
## [18,] &quot;Authors@R&quot;               &quot;SystemRequirements&quot; 
## [19,] &quot;Biarch&quot;                  &quot;Title&quot;              
## [20,] &quot;BugReports&quot;              &quot;Type&quot;               
## [21,] &quot;BuildKeepEmpty&quot;          &quot;URL&quot;                
## [22,] &quot;BuildManual&quot;             &quot;VignetteBuilder&quot;    
## [23,] &quot;BuildResaveData&quot;         &quot;ZipData&quot;            
## [24,] &quot;BuildVignettes&quot;          &quot;Published&quot;          
## [25,] &quot;Built&quot;                   &quot;Path&quot;               
## [26,] &quot;ByteCompile&quot;             &quot;X-CRAN-Comment&quot;     
## [27,] &quot;Classification/ACM&quot;      &quot;Reverse depends&quot;    
## [28,] &quot;Classification/ACM-2012&quot; &quot;Reverse imports&quot;    
## [29,] &quot;Classification/JEL&quot;      &quot;Reverse linking to&quot; 
## [30,] &quot;Classification/MSC&quot;      &quot;Reverse suggests&quot;   
## [31,] &quot;Classification/MSC-2010&quot; &quot;Reverse enhances&quot;   
## [32,] &quot;Collate&quot;                 &quot;MD5sum&quot;             
## [33,] &quot;Collate.unix&quot;            &quot;Package&quot;</code></pre>
<p>Looking at a few rows and columns gives a feel for how complicated its structure is.</p>
<pre><code>p_db[1:10, c(1,2,4,5)]</code></pre>
<pre><code>##        Package Version                                             Depends
## 1           A3   1.0.0                      R (>= 2.15.0), xtable, pbapply
## 2       abbyyR   0.5.4                                        R (>= 3.2.0)
## 3          abc     2.1 R (>= 2.10), abc.data, nnet, quantreg, MASS, locfit
## 4     abc.data     1.0                                         R (>= 2.10)
## 5      ABC.RAP   0.9.0                                        R (>= 3.1.0)
## 6  ABCanalysis   1.2.1                                         R (>= 2.10)
## 7     abcdeFBA     0.4              Rglpk,rgl,corrplot,lattice,R (>= 2.10)
## 8     ABCoptim  0.15.0                                                </code></pre>