README.md

rte.data

Access data from RTE data portal

Project Status: WIP – Initial development is in progress, but there
has not yet been a stable, usable release suitable for the
public. Travis build
status

Overview

RTE, the french electricity transmission system operator, provides access to various data through an API on its data portal. You can retrieve those data with rte.data.

Installation (from Github) :

source("https://install-github.me/dreamRs/rte.data")

# or
devtools::install_github("dreamRs/rte.data")

Authentication

To access the API, you need to create an account, or login if you have one.

Once logged, you can subscribe (create an application) to the desired API (each APIs must be subscribed individualy), you’ll obtain an client id and a client secret (or directly a base64 encoded key). Use those to get a token :

# To create a token you can use id_client and id_secret
id_client <- "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
id_secret <- "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
token <- get_token(
  key = list(id_client = id_client, id_secret = id_secret)
)

# or the base64 encoded key
key <- "TGEgZGF0YXNjaWVuY2UgYXZlYyB1biBncmFuZCBS="
token <- get_token(key)

With this token, you can query the API. You need to generate a token every \~two hours, but you can use the same key each time.

So for future use, you can store your credentials in your .Renviron with set_key.

Examples

Consumption

Data on French electricity consumption in real time, with forecast :

short_term <- get_consumption("short_term", type = c("REALISED", "D-1"))
short_term

autoplot(short_term)

Physical flows

Data about physical cross-border schedules detailing electricity flows actually transiting across the interconnection lines directly linking countries.

balance <- get_physical_flows(start_date = "2018-02-01", end_date = "2018-03-15")
autoplot(balance)

autoplot(balance, by_country = TRUE)

Actual generation

Generation data aggregated by sector and produced per group (in MW) on an intradaily basis for net generation injected into the network.

prod_type_30 <- get_actual_generation(
  resource = "actual_generations_per_production_type",
  start_date = Sys.Date() - 30, end_date = Sys.Date()
)

autoplot(prod_type_30, by_day = TRUE)

Active production units

active_units <- retrieve_active_units()
autoplot(active_units)

or see on a map :

autoplot(active_units, map = TRUE)

Generation installed capacities

inst_cap <- get_open_api(
  api = "generation_installed_capacities",
  resource = "capacities_per_production_unit"
)

autoplot(inst_cap)



dreamRs/rte.data documentation built on June 18, 2019, 8:02 a.m.