read_RStudio_CRAN_data: Reads RStudio CRAN mirror data files from a folder

View source: R/RStudio_CRAN_data.R

read_RStudio_CRAN_dataR Documentation

Reads RStudio CRAN mirror data files from a folder

Description

This function reads files downloaded from the download page (http://cran-logs.rstudio.com/).

This function relies on data.table to run faster. WARNING: this function can be quite slow...

Usage

read_RStudio_CRAN_data(
  log_folder = tempdir(),
  use_data_table = TRUE,
  packages,
  ...
)

Arguments

log_folder

the folder which contains the RStudio CRAN log files that were downloaded to. Default is the temporary folder picked by tempdir.

use_data_table

default is TRUE. A switch for wether or not to use the data.table package in order to merge the log files using rbindlist. This function is MUCH faster then the alternative.

packages

a character vector containing the names of packages for which information is extracted. If not specified, all packages are included, but this can cause out-of-memory problems if there are many log files.

...

not in use.

Details

RStudio maintains its own CRAN mirror, https://cran.rstudio.com/ and offers its log files.

Value

Returns the combined data file.

Author(s)

Felix Schonbrodt, Tal Galili

Source

https://www.nicebread.de/finally-tracking-cran-packages-downloads/

See Also

download_RStudio_CRAN_data, read_RStudio_CRAN_data,barplot_package_users_per_day

Examples

## Not run: 
# The first two functions might take a good deal of time to run (depending on the date range)
RStudio_CRAN_data_folder <- 
      download_RStudio_CRAN_data(START = '2013-04-02',
                                 END = '2013-04-05') 
                                 # around the time R 3.0.0 was released
my_RStudio_CRAN_data <- read_RStudio_CRAN_data(RStudio_CRAN_data_folder)

# barplots: (more functions can easily be added in the future)
barplot_package_users_per_day("installr", my_RStudio_CRAN_data)
barplot_package_users_per_day("plyr", my_RStudio_CRAN_data)

## End(Not run)

talgalili/installr documentation built on Feb. 19, 2024, 1:22 p.m.