Date: February 28th, 2020

Comisión Federal de Electricidad

This page is created as the assignment for JHU - Coursera Data Science specialization course, Developing Data Products, corresponding to week 2. I’ll be working with a data base that I created, which can be downloaded here. It shows the power plants of the Mexican Power Utility CFE, with the location, capacity, anual energy generation, among other miscelaneous data. I actually had to get the coordinates by hand from pdf’s. Though I had compiled the data and used it with GIS software, I thought I’d give it a try with leaflet. Hope you like it.

CFE

Mexico has a Public Power Utility owned by the State named “Comisión Federal de Electricidad” or “CFE”. For legal reasons, CFE’s power plants are divided in many utilities so that they compete (since there are private power stations that also sell power to the Market). Here we show a map of how the power stations were assigned before november 2019

However, the new government reassigned the power plants, in order to concentrate them in certain areas, which might result in competition issues. This is how the current location of the power plants looks like.

As you can see, each utility now “controls” a region, instead of being somewhat evenly scattered throughout the country.

Code Chunks

First Map

library(leaflet); library(dplyr); library(tidyr)

powerPlants <- read.csv(file = ".\\CFE_power_plants.csv", header = TRUE, 
         stringsAsFactors = FALSE)

powerPlants %>%
     leaflet() %>% 
     addTiles() %>% 
     addCircleMarkers(color = powerPlants$col_2019) %>% 
     addMarkers(clusterOptions = markerClusterOptions(), 
                popup =  paste("Permit Number", powerPlants$Permit.Number, "<br>",
                           "Name:", powerPlants$Name, "<br>",
                           "Capacity (MW):", powerPlants$Power..MW., "<br>",
                           "Anual Generation (GWh):", powerPlants$Energy..MWh.)) %>%
     addLegend(labels = c("Generation I", "Generation II", "Generation III", 
                          "Generation IV", "Generation VI", "CFE Holding"), 
               colors = c("deepskyblue", "darkblue", "red", "brown", "gold", 
                          "green"))

Second Map:

powerPlants %>%
     leaflet() %>% 
     addTiles() %>% 
     addCircleMarkers(color = powerPlants$col_2020) %>% 
     addMarkers(clusterOptions = markerClusterOptions(), 
                popup =  paste("Permit Number", powerPlants$Permit.Number, "<br>",
                           "Name:", powerPlants$Name, "<br>",
                           "Capacity (MW):", powerPlants$Power..MW., "<br>",
                           "Anual Generation (GWh):", powerPlants$Energy..MWh.)) %>%
     addLegend(labels = c("Generation I", "Generation II", "Generation III", 
                          "Generation IV", "Generation VI", "CFE Holding"), 
               colors = c("deepskyblue", "darkblue", "red", "brown", "gold", 
                          "green"))