knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(Team05Lab05)

Lab05: A package connecting to a web API

For this lab, we created a package which connects to the carbon intensity API. You can follow this link to the Carbon Intensity UK API

Getting to know the regions.

The API connects to data from 17 different regions. You can see the regions here or calling the regions() function.

    regions()  

Get the electricity sources used between specified datetimes for a specified region.

The check_fuel_region_time function returns a dataframe with the fuels used in an interval of time. When calling the function, you have to add the following parameters.

Example

Using the following command

check_fuel_region_time("Scotland", "2018-11-16T09:00Z", "2018-12-10T16:00Z")

we will get a data frame containing the fuels used between the time interval [from, to] in the specified region.

check_fuel_region_time("Scotland", "2018-11-16T09:00Z", "2018-12-10T16:00Z")

Plotting the electricity sources used between specified datetimes for a specified region.

The pie_API_2 function returns a plot of the fuels used in an interval of time. When calling the function, you have to add the following parameters.

Example

Using the following command

pie_API_2("Scotland", "2018-11-16T09:00Z", "2018-12-10T16:00Z")

we will get a plot of the fuels used between the time interval [from, to] in the specified region.

pie_API_2("Scotland", "2018-11-16T09:00Z", "2018-12-10T16:00Z")


atikh281/Lab05 documentation built on Nov. 3, 2019, 1:59 p.m.