México’s Hydroelectric Power 2016

Bruno Gonzalez

October 18, 2016

Introduction

Getting and Cleaning Data

–First a read the data and manipulated it to make the plot. In the presentation I’m ploting just January, but int he Shiny App, the month can be choosen.

library(plotly)
setwd("C:/Users/Bruno Gonzalez/Documents")

hydro_gen <- read.csv("generacionHidro.csv")
hydro_gen$FECHA <- as.Date(hydro_gen$FECHA, "%d/%m/%y")

month <- "01"
hydro_month <- subset(hydro_gen, format.Date(FECHA, "%m")== month)
dup <- duplicated(format.Date(hydro_month$FECHA, "%d"))
days <- format.Date(hydro_month[!dup,]$FECHA, "%d")

days_m <- matrix(hydro_month$TOTAL, nrow = 24, ncol = length(days))

Ploting

– The plot presents by hour and by day the hydroelectrical generation. I used plotly to make the 3d plot

plot_ly(z=days_m, type="surface") %>%
layout(scene = list(
    xaxis=list(title="Days"), yaxis=list(title="Hours"), zaxis=list(title="MWh")))

Conclusions

– The plot clearly shows the peak month and hour on the hidroelectrical system.

Thank you