V3: Tools for task views

Patrice Kiener



RWsearch stands for « Search in R packages, task views, CRAN and in the Web ».

RWsearch is a management tool that serves several purposes:

  1. Provide a simple instruction to read and evaluate non-standard content (non-standard evaluation).
  2. Download the list of all packages and task views available on CRAN at a given date and rearrange them in a convenient format.
  3. List the packages that has been added, updated and removed between two dates.
  4. Search packages that match one or several keywords (with mode or, and, relax) in any column of the data.frame and by default in columns Package name, Title, Description, Author and Maintainer (can be selected individually).
  5. Arrange the results in different format (list, tables with different columns) and display them in console or in txt, md, html, pdf files.
  6. In one instruction, download on your disk the whole documentation related to one or several packages. This is the perfect tool to read the documentation off-line.
  7. Provide tools for task view maintenance: Detect the packages recently added to or updated in CRAN, check if they match some keywords, check if they are already recorded in a given task views.
  8. Provide quick links to launch web search engines and search for keywords from the R console. This list of web search engines is expected to grow (with your help).

Compare to other packages (packagefinder, websearchr) or web services (RDocumentation, rdrr) with similar objectives, the search options of RWsearch are more sophisticated and allow for a finer search. RWsearch also addresses a much larger number of web search engines. Non-standard evaluation (or evaluation of non-standard content) makes it user friendly.

This vignette deals with point 7. Points 1 to 6 and point 8 are discussed in other vignettes.

Task views

Task views are an important part of CRAN as they help R users to find the packages that match their needs. Task view pages are maintained by volunteers who update the pages and upload them to CRAN with the package ctv.

RWsearch focuses on detecting the (old and new) packages that could be added to the task views.

View, download, load and explore task views

As a preliminary, all task views can be read on-line with the instruction:

# Open the html page of CRAN task views in the browser

RWsearch provides the functions tvdb_down() and tvdb_load() to download a file renamed or load the task views in .GlobalEnv as a list named tvdb. Four functions are available to explore this list: tv_vec(), tvdb_dfr(), tvdb_list(), tvdb_pkgs().

crandb_down(), tvdb_down(), crandb_load(), tvdb_load()

In an empty directory, the two files crandb.rda and tvdb.rda, which are cleaned versions of the files /web/packages/packages.rds and /src/contrib/Views.rds, must be downloaded from CRAN. Once downloaded, the files are automatically loaded with names crandb (a data.frame) and tvdb (a list) in .GlobalEnv. The most recently updated task view can have an older date than the saved date.

If the files already exist in one specific directory, they can be loaded:

tvdb_vec(), tvdb_dfr()

Functions tv_vec() and tvdb_dfr() list the task views available and their topics.

There are 39 task views in February 2019. The largest task view is Time Series with 273 referred packages. 31 task views have been updated in the last 100 days and 37 task views in the last 12 months.


#    version    npkgs name                      topic                                                                
# 1  2019-01-29 131   Bayesian                  Bayesian Inference                                                   
# 2  2019-02-05  91   ChemPhys                  Chemometrics and Computational Physics                               
# 3  2019-02-20  51   ClinicalTrials            Clinical Trial Design, Monitoring, and Analysis                      
# 4  2019-01-14 111   Cluster                   Cluster Analysis & Finite Mixture Models                             
# 5  2019-02-04  38   Databases                 Databases with R                                                     
# 6  2019-01-26  29   DifferentialEquations     Differential Equations                                               
# 7  2019-01-26 208   Distributions             Probability Distributions                                            
# 8  2019-01-26 139   Econometrics              Econometrics                                                         
# 9  2019-01-17 104   Environmetrics            Analysis of Ecological and Environmental Data                        
# 10 2018-05-26 124   ExperimentalDesign        Design of Experiments (DoE) & Analysis of Experimental Data          
# 11 2018-12-03  24   ExtremeValue              Extreme Value Analysis                                               
# 12 2019-01-26 154   Finance                   Empirical Finance                                                    
# 13 2019-01-26  40   FunctionalData            Functional Data Analysis                                             
# 14 2019-01-26  26   Genetics                  Statistical Genetics                                                 
# 15 2019-01-29  35   gR                        gRaphical Models in R                                                
# 16 2015-01-07  41   Graphics                  Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization
# 17 2018-10-30  97   HighPerformanceComputing  High-Performance and Parallel Computing with R                       
# 18 2019-01-24  86   Hydrology                 Hydrological Data and Modeling                                       
# 19 2019-02-19 102   MachineLearning           Machine Learning & Statistical Learning                              
# 20 2018-11-30  32   MedicalImaging            Medical Image Analysis                                               
# 21 2019-01-26 104   MetaAnalysis              Meta-Analysis                                                        
# 22 2019-02-25 142   MissingData               Missing Data                                                         
# 23 2019-02-04  31   ModelDeployment           Model Deployment with R                                              
# 24 2018-07-21 121   Multivariate              Multivariate Statistics                                              
# 25 2017-11-29  55   NaturalLanguageProcessing Natural Language Processing                                          
# 26 2019-02-17  96   NumericalMathematics      Numerical Mathematics                                                
# 27 2019-01-23 123   OfficialStatistics        Official Statistics & Survey Methodology                             
# 28 2019-02-17 127   Optimization              Optimization and Mathematical Programming                            
# 29 2018-06-11  12   Pharmacokinetics          Analysis of Pharmacokinetic Data                                     
# 30 2019-02-14  94   Phylogenetics             Phylogenetics, Especially Comparative Methods                        
# 31 2019-02-11 209   Psychometrics             Psychometric Models and Methods                                      
# 32 2019-01-26  59   ReproducibleResearch      Reproducible Research                                                
# 33 2018-06-18  60   Robust                    Robust Statistical Methods                                           
# 34 2018-06-18  82   SocialSciences            Statistics for the Social Sciences                                   
# 35 2019-02-25 194   Spatial                   Analysis of Spatial Data                                             
# 36 2019-02-05  65   SpatioTemporal            Handling and Analyzing Spatio-Temporal Data                          
# 37 2019-01-26 264   Survival                  Survival Analysis                                                    
# 38 2019-02-12 273   TimeSeries                Time Series Analysis                                                 
# 39 2019-02-25 247   WebTechnologies           Web Technologies and Services                                        

tvdb_list(), tvdb_pkgs()

tv_list() lists all task view packages. tvdb_dfr() lists the packages of the task views selected by the user.

Counting the number of referred packages

The largest task view has referred 273 packages. All task views have referred 4021 packages but only 3221 unique packages. This is 23.4 % of the total number of packages currently in CRAN. The task is immense if we want to refer all packages.

Task view maintenance

RWsearch focuses on detecting the (old and new) packages that could be added to the task views.

Function s_crandb_tvdb() combines many functions of RWsearch. It searchs packages in crandb by keywords and checks if the found packages are referred in the selected task view and installed in the computer (in the /site-library directory).

The example presented below refers to the Distributions task view.


The output of s_crandb_tvdb() is a list with the following items:

Visualize the unreferred packages

A first assesment of the packages that match the keywords can be done with p_table2(). Consider also p_display5() to read the results in the browser.

p_table2(), p_display5()

From this list and the DESCRIPTION in the html page, packages GB2group, MixGHD, pgdraw and philentropy deserve further exploration.

p_page(), p_pdfweb()

4 packages is a reasonnable number. We can open the CRAN/index.html pages and CRAN/manual.pdf files in the browser. Alternatively, consider downloading the documentation of these packages.

The pdf files and the vignettes give all expected information:

For these packages, the quality of the d,p,q,r functions should be explored (but has not been yet).