R Project for Statistical Computing

Use the simple Cranlogs API to obtain base R download 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 base R 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/R

The response is a JSON object that contains the start date (Jan 01, 2019), end date (Jun 01, 2019) and the total R downloads 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/R")

Now, the task is to obtain the total base R downloads in 2018 and save the results in a single CSV file containing the headers: "start", "end" and "downloads".

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

Task tags

  • code
  • r statistical computing
  • cranlogs

Students who completed this task

Adam Z, kknet

Task type

  • code Code