R Project for Statistical Computing

Use the simple Cranlogs API to obtain half-yearly R package downloads summaries in 2018

The R-Hub cranlogs API is a very simple API to query using a web browser or R. You can read more about this API here: https://github.com/r-hub/cranlogs.app

This task involves using this API to obtain data for total R package downloads for a specified period of time.

Example 1 - Using a web browser: Copy and paste the following URL into a web browser https://cranlogs.r-pkg.org/downloads/total/2019-01-01:2019-06-01

The response is a JSON object that contains the start date (Jan 01, 2019), end date (Jun 01, 2019) and the total download of all R packages for the time period.

Example 2 - Using R: install the jsonlite R package. Then from the R console execute this statement: jsonlite::fromJSON("https://cranlogs.r-pkg.org/downloads/total/2019-01-01:2019-06-01")

Now, the task is to obtain the total downloads of all R packages in 2018, half-yearly and save the results in a single CSV file. This means you will obtain total downloads from January 01 to June 30, and from July 01 to December 31 for the year.

Submit the result at https://github.com/benubah/gci2019

Task tags

  • cranlogs
  • r statistical computing
  • api

Students who completed this task

Srish1305, SR Tang

Task type

  • code Code