import data

GeneratorData <- read.csv("~/GeneratorData.csv")

view data

head(GeneratorData)
##   ï..Utility.ID     Utility.Name Plant.Code   Plant.Name State     County
## 1           195 Alabama Power Co          2 Bankhead Dam    AL Tuscaloosa
## 2           195 Alabama Power Co          3        Barry    AL     Mobile
## 3           195 Alabama Power Co          3        Barry    AL     Mobile
## 4           195 Alabama Power Co          3        Barry    AL     Mobile
## 5           195 Alabama Power Co          3        Barry    AL     Mobile
## 6           195 Alabama Power Co          3        Barry    AL     Mobile
##   Generator.ID                       Technology Prime.Mover Unit.Code
## 1            1       Conventional Hydroelectric          HY          
## 2            1        Natural Gas Steam Turbine          ST          
## 3            2        Natural Gas Steam Turbine          ST          
## 4            4          Conventional Steam Coal          ST          
## 5            5          Conventional Steam Coal          ST          
## 6         A1CT Natural Gas Fired Combined Cycle          CT      G521
##   Ownership Duct.Burners Can.Bypass.Heat.Recovery.Steam.Generator.
## 1         S            X                                         X
## 2         S            X                                         X
## 3         S            X                                         X
## 4         S            X                                         X
## 5         S            X                                         X
## 6         S            X                                         N
##   RTO.ISO.LMP.Node.Designation
## 1                             
## 2                             
## 3                             
## 4                             
## 5                             
## 6                             
##   RTO.ISO.Location.Designation.for.Reporting.Wholesale.Sales.Data.to.FERC
## 1                                                                        
## 2                                                                        
## 3                                                                        
## 4                                                                        
## 5                                                                        
## 6                                                                        
##   Nameplate.Capacity..MW. Nameplate.Power.Factor Summer.Capacity..MW.
## 1                    53.9                   0.92                 53.0
## 2                   153.1                   0.85                 55.5
## 3                   153.1                   0.85                 55.5
## 4                   403.7                   0.85                362.0
## 5                   788.8                   0.85                756.5
## 6                   170.1                   0.85                175.6
##   Winter.Capacity..MW. Minimum.Load..MW.
## 1                 53.0                52
## 2                 55.5                55
## 3                 55.5                55
## 4                362.0               200
## 5                756.5               465
## 6                184.5               104
##   Uprate.or.Derate.Completed.During.Year Month.Uprate.or.Derate.Completed
## 1                                      N                               NA
## 2                                      N                               NA
## 3                                      N                               NA
## 4                                      N                               NA
## 5                                      N                               NA
## 6                                      N                               NA
##   Year.Uprate.or.Derate.Completed Status Synchronized.to.Transmission.Grid
## 1                              NA     OP                                 X
## 2                              NA     OP                                 X
## 3                              NA     OP                                 X
## 4                              NA     OP                                 X
## 5                              NA     OP                                 X
## 6                              NA     OP                                 X
##   Operating.Month Operating.Year Planned.Retirement.Month
## 1               7           1963                       NA
## 2               2           1954                       NA
## 3               7           1954                       NA
## 4              12           1969                       NA
## 5              10           1971                       NA
## 6               5           2000                       NA
##   Planned.Retirement.Year Associated.with.Combined.Heat.and.Power.System
## 1                      NA                                              N
## 2                      NA                                              N
## 3                      NA                                              N
## 4                      NA                                              N
## 5                      NA                                              N
## 6                      NA                                              N
##        Sector.Name Sector Topping.or.Bottoming Energy.Source.1
## 1 Electric Utility      1                    X             WAT
## 2 Electric Utility      1                    X              NG
## 3 Electric Utility      1                    X              NG
## 4 Electric Utility      1                    X             BIT
## 5 Electric Utility      1                    X             BIT
## 6 Electric Utility      1                    X              NG
##   Energy.Source.2 Energy.Source.3 Energy.Source.4 Energy.Source.5
## 1                                                                
## 2                                                                
## 3                                                                
## 4                                                                
## 5                                                                
## 6                                                                
##   Energy.Source.6 Startup.Source.1 Startup.Source.2 Startup.Source.3
## 1                                                                   
## 2                               NG                                  
## 3                               NG                                  
## 4                               NG                                  
## 5                               NG                                  
## 6                                                                   
##   Startup.Source.4 Solid.Fuel.Gasification.System.
## 1                                                 
## 2                                                 
## 3                                                 
## 4                                                 
## 5                                                 
## 6                                                 
##   Carbon.Capture.Technology. Turbines.or.Hydrokinetic.Buoys
## 1                                                         0
## 2                                                        NA
## 3                                                        NA
## 4                                                        NA
## 5                                                        NA
## 6                                                        NA
##   Time.from.Cold.Shutdown.to.Full.Load Fluidized.Bed.Technology.
## 1                                   1H                          
## 2                                 OVER                          
## 3                                 OVER                          
## 4                                 OVER                          
## 5                                 OVER                          
## 6                                  12H                          
##   Pulverized.Coal.Technology. Stoker.Technology.
## 1                                               
## 2                                               
## 3                                               
## 4                           Y                   
## 5                           Y                   
## 6                                               
##   Other.Combustion.Technology. Subcritical.Technology.
## 1                                                     
## 2                                                     
## 3                                                     
## 4                                                    Y
## 5                                                     
## 6                                                     
##   Supercritical.Technology. Ultrasupercritical.Technology.
## 1                                                         
## 2                                                         
## 3                                                         
## 4                                                         
## 5                         Y                               
## 6                                                         
##   Planned.Net.Summer.Capacity.Uprate..MW.
## 1                                      NA
## 2                                      NA
## 3                                      NA
## 4                                      NA
## 5                                      NA
## 6                                      NA
##   Planned.Net.Winter.Capacity.Uprate..MW. Planned.Uprate.Month
## 1                                      NA                   NA
## 2                                      NA                   NA
## 3                                      NA                   NA
## 4                                      NA                   NA
## 5                                      NA                   NA
## 6                                      NA                   NA
##   Planned.Uprate.Year Planned.Net.Summer.Capacity.Derate..MW.
## 1                  NA                                      NA
## 2                  NA                                      NA
## 3                  NA                                      NA
## 4                  NA                                      NA
## 5                  NA                                      NA
## 6                  NA                                      NA
##   Planned.Net.Winter.Capacity.Derate..MW. Planned.Derate.Month
## 1                                      NA                   NA
## 2                                      NA                   NA
## 3                                      NA                   NA
## 4                                      NA                   NA
## 5                                      NA                   NA
## 6                                      NA                   NA
##   Planned.Derate.Year Planned.New.Prime.Mover Planned.Energy.Source.1
## 1                  NA                                                
## 2                  NA                                                
## 3                  NA                                                
## 4                  NA                                                
## 5                  NA                                                
## 6                  NA                                                
##   Planned.New.Nameplate.Capacity..MW. Planned.Repower.Month
## 1                                  NA                    NA
## 2                                  NA                    NA
## 3                                  NA                    NA
## 4                                  NA                    NA
## 5                                  NA                    NA
## 6                                  NA                    NA
##   Planned.Repower.Year Other.Planned.Modifications.
## 1                   NA                             
## 2                   NA                             
## 3                   NA                             
## 4                   NA                             
## 5                   NA                             
## 6                   NA                             
##   Other.Modifications.Month Other.Modifications.Year Multiple.Fuels.
## 1                        NA                       NA               N
## 2                        NA                       NA               N
## 3                        NA                       NA               N
## 4                        NA                       NA               N
## 5                        NA                       NA               N
## 6                        NA                       NA               N
##   Cofire.Fuels. Switch.Between.Oil.and.Natural.Gas.
## 1                                                  
## 2             N                                    
## 3                                                  
## 4                                                  
## 5                                                  
## 6

get Oklahoma generation:

library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.1
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
OklahomaGeneration <- GeneratorData %>% 
  filter(State == "OK")
OklahomaGeneration <- edit(OklahomaGeneration)
head(OklahomaGeneration)
##   Utility.ID                       Utility.Name Plant.Code     Plant.Name
## 1       7490          Grand River Dam Authority        165           GREC
## 2       7490          Grand River Dam Authority        165           GREC
## 3       7490          Grand River Dam Authority        165           GREC
## 4       7490          Grand River Dam Authority        165           GREC
## 5      14077 Oklahoma Municipal Power Authority        762          Ponca
## 6      14063         Oklahoma Gas & Electric Co       2951 Horseshoe Lake
##   State   County Generator.ID                           Technology
## 1    OK    Mayes            1            Natural Gas Steam Turbine
## 2    OK    Mayes            2              Conventional Steam Coal
## 3    OK    Mayes          3CT     Natural Gas Fired Combined Cycle
## 4    OK    Mayes          3ST     Natural Gas Fired Combined Cycle
## 5    OK      Kay            2            Natural Gas Steam Turbine
## 6    OK Oklahoma           10 Natural Gas Fired Combustion Turbine
##   Prime.Mover Unit.Code Ownership Duct.Burners
## 1          ST                   S            X
## 2          ST                   S            X
## 3          CT      CT03         S            X
## 4          CA      CT03         S            Y
## 5          ST                   S            X
## 6          GT                   S            X
##   Can.Bypass.Heat.Recovery.Steam.Generator. RTO.ISO.LMP.Node.Designation
## 1                                         X                GRDAGRDA17UN1
## 2                                         X                GRDAGRDA17UN2
## 3                                         N             GRDAGREC3UNGREC3
## 4                                         X             GRDAGREC3UNGREC3
## 5                                         X                             
## 6                                         X                    OKGEHL910
##   RTO.ISO.Location.Designation.for.Reporting.Wholesale.Sales.Data.to.FERC
## 1                                                        GRDAGRDA17UN1_RA
## 2                                                        GRDAGRDA17UN2_RA
## 3                                                        GRDAGREC3UNGREC3
## 4                                                        GRDAGREC3UNGREC3
## 5                                                                        
## 6                                                               OKGEHL910
##   Nameplate.Capacity..MW. Nameplate.Power.Factor Summer.Capacity..MW.
## 1                   540.0                   0.90                 40.0
## 2                   594.0                   0.90                492.0
## 3                   369.0                   0.90                307.0
## 4                   231.3                   0.90                160.5
## 5                    48.0                   0.85                 34.0
## 6                    60.5                   0.90                 41.8
##   Winter.Capacity..MW. Minimum.Load..MW.
## 1                 40.0              10.0
## 2                492.0             150.0
## 3                307.0             160.0
## 4                160.5             100.0
## 5                 34.0               5.0
## 6                 41.8              41.8
##   Uprate.or.Derate.Completed.During.Year Month.Uprate.or.Derate.Completed
## 1                                      N                               NA
## 2                                      N                               NA
## 3                                      N                               NA
## 4                                      N                               NA
## 5                                      N                               NA
## 6                                      N                               NA
##   Year.Uprate.or.Derate.Completed Status Synchronized.to.Transmission.Grid
## 1                              NA     OP                                 X
## 2                              NA     OP                                 X
## 3                              NA     OP                                 X
## 4                              NA     OP                                 X
## 5                              NA     OP                                 X
## 6                              NA     OP                                 X
##   Operating.Month Operating.Year Planned.Retirement.Month
## 1               6           1981                       NA
## 2              10           1985                       NA
## 3              12           2017                       NA
## 4              12           2017                       NA
## 5              10           1977                       NA
## 6               6           2001                       NA
##   Planned.Retirement.Year Associated.with.Combined.Heat.and.Power.System
## 1                      NA                                              N
## 2                      NA                                              N
## 3                      NA                                              N
## 4                      NA                                              N
## 5                      NA                                              N
## 6                      NA                                              N
##        Sector.Name Sector Topping.or.Bottoming Energy.Source.1
## 1 Electric Utility      1                    X              NG
## 2 Electric Utility      1                    X             SUB
## 3 Electric Utility      1                    X              NG
## 4 Electric Utility      1                    X              NG
## 5 Electric Utility      1                    X              NG
## 6 Electric Utility      1                    X              NG
##   Energy.Source.2 Energy.Source.3 Energy.Source.4 Energy.Source.5
## 1                                                                
## 2                                                                
## 3                                                                
## 4                                                                
## 5                                                                
## 6                                                                
##   Energy.Source.6 Startup.Source.1 Startup.Source.2 Startup.Source.3
## 1                               NG                                  
## 2                               NG                                  
## 3                                                                   
## 4                                                                   
## 5                               NG                                  
## 6                                                                   
##   Startup.Source.4 Solid.Fuel.Gasification.System.
## 1                                                N
## 2                                                N
## 3                                                N
## 4                                                N
## 5                                                N
## 6                                                N
##   Carbon.Capture.Technology. Turbines.or.Hydrokinetic.Buoys
## 1                          N                              0
## 2                          N                              0
## 3                          N                              0
## 4                          N                              0
## 5                          N                             NA
## 6                          N                             NA
##   Time.from.Cold.Shutdown.to.Full.Load Fluidized.Bed.Technology.
## 1                                 OVER                          
## 2                                 OVER                          
## 3                                  12H                          
## 4                                  12H                          
## 5                                   1H                          
## 6                                   1H                          
##   Pulverized.Coal.Technology. Stoker.Technology.
## 1                                               
## 2                           Y                   
## 3                                               
## 4                                               
## 5                                               
## 6                                               
##   Other.Combustion.Technology. Subcritical.Technology.
## 1                                                     
## 2                                                    Y
## 3                                                     
## 4                                                    N
## 5                                                     
## 6                                                     
##   Supercritical.Technology. Ultrasupercritical.Technology.
## 1                                                         
## 2                                                         
## 3                                                         
## 4                                                         
## 5                                                         
## 6                                                         
##   Planned.Net.Summer.Capacity.Uprate..MW.
## 1                                      NA
## 2                                      NA
## 3                                      NA
## 4                                      NA
## 5                                      NA
## 6                                      NA
##   Planned.Net.Winter.Capacity.Uprate..MW. Planned.Uprate.Month
## 1                                      NA                   NA
## 2                                      NA                   NA
## 3                                      NA                   NA
## 4                                      NA                   NA
## 5                                      NA                   NA
## 6                                      NA                   NA
##   Planned.Uprate.Year Planned.Net.Summer.Capacity.Derate..MW.
## 1                  NA                                      NA
## 2                  NA                                      NA
## 3                  NA                                      NA
## 4                  NA                                      NA
## 5                  NA                                      NA
## 6                  NA                                      NA
##   Planned.Net.Winter.Capacity.Derate..MW. Planned.Derate.Month
## 1                                      NA                   NA
## 2                                      NA                   NA
## 3                                      NA                   NA
## 4                                      NA                   NA
## 5                                      NA                   NA
## 6                                      NA                   NA
##   Planned.Derate.Year Planned.New.Prime.Mover Planned.Energy.Source.1
## 1                  NA                                                
## 2                  NA                                                
## 3                  NA                                                
## 4                  NA                                                
## 5                  NA                                                
## 6                  NA                                                
##   Planned.New.Nameplate.Capacity..MW. Planned.Repower.Month
## 1                                  NA                    NA
## 2                                  NA                    NA
## 3                                  NA                    NA
## 4                                  NA                    NA
## 5                                  NA                    NA
## 6                                  NA                    NA
##   Planned.Repower.Year Other.Planned.Modifications.
## 1                   NA                            N
## 2                   NA                            N
## 3                   NA                            N
## 4                   NA                            N
## 5                   NA                             
## 6                   NA                             
##   Other.Modifications.Month Other.Modifications.Year Multiple.Fuels.
## 1                        NA                       NA               N
## 2                        NA                       NA               N
## 3                        NA                       NA               N
## 4                        NA                       NA               N
## 5                        NA                       NA               N
## 6                        NA                       NA               N
##   Cofire.Fuels. Switch.Between.Oil.and.Natural.Gas.
## 1             N                                   N
## 2             N                                   N
## 3             N                                   N
## 4             N                                   N
## 5                                                  
## 6             N                                   N

import wind data

WindData <- read.csv("~/WindData.csv")
head(WindData)
##   ï..Utility.ID                          Utility.Name Plant.Code
## 1         13642            Nome Joint Utility Systems         90
## 2         13642            Nome Joint Utility Systems         90
## 3         13642            Nome Joint Utility Systems         90
## 4         10633                  City of Lamar - (CO)        508
## 5         10633                  City of Lamar - (CO)        508
## 6         56990 NJR Clean Energy Ventures Corporation        692
##     Plant.Name State  County Generator.ID Status           Technology
## 1  Snake River    AK    Nome          ENT     OA Onshore Wind Turbine
## 2  Snake River    AK    Nome        EWT 1     OP Onshore Wind Turbine
## 3  Snake River    AK    Nome        EWT 2     OP Onshore Wind Turbine
## 4  Lamar Plant    CO Prowers        T1-T3     OP Onshore Wind Turbine
## 5  Lamar Plant    CO Prowers           T4     OP Onshore Wind Turbine
## 6 Medicine Bow    WY  Carbon           10     OP Onshore Wind Turbine
##   Prime.Mover      Sector.Name Sector Nameplate.Capacity..MW.
## 1          WT Electric Utility      1                     0.8
## 2          WT Electric Utility      1                     0.9
## 3          WT Electric Utility      1                     0.9
## 4          WT Electric Utility      1                     4.5
## 5          WT Electric Utility      1                     1.5
## 6          WT      IPP Non-CHP      2                     0.7
##   Summer.Capacity..MW. Winter.Capacity..MW. Operating.Month Operating.Year
## 1                  0.8                  0.8               1           2015
## 2                  0.9                  0.9               7           2013
## 3                  0.9                  0.9               7           2013
## 4                  4.0                  4.0               2           2004
## 5                  1.5                  1.5               2           2004
## 6                  0.7                  0.7               7           2000
##   Number.of.Turbines Predominant.Turbine.Manufacturer
## 1                 15           Entegrity Wind Systems
## 2                  1                              EWT
## 3                  1                              EWT
## 4                  3                               GE
## 5                  1                               GE
## 6                  9                           Vestas
##   Predominant.Turbine.Model.Number Design.Wind.Speed..mph.
## 1                             EW50                    20.0
## 2                         DW54-900                    20.0
## 3                         DW54-900                    20.0
## 4                          1.5 XLE                    19.0
## 5                          1.5 XLE                    19.0
## 6                          V47-660                    18.8
##   Wind.Quality.Class Turbine.Hub.Height..Feet.
## 1                  2                     102.0
## 2                  2                     164.0
## 3                  2                     164.0
## 4                  2                     262.4
## 5                  2                     262.4
## 6                  2                     164.0

get Oklahoma wind data:

library(dplyr)
OklahomaWind <- WindData %>% 
  filter(State == "OK" & Status == "OP") 
OklahomaWind <- edit(OklahomaWind)
head(OklahomaWind)
##   Utility.ID                 Utility.Name Plant.Code
## 1       1881    Blue Canyon Windpower LLC      56081
## 2      34719 FPL Energy Oklahoma Wind LLC      56094
## 3      34719 FPL Energy Oklahoma Wind LLC      56094
## 4      50014  FPL Energy Weatherford, LLC      56273
## 5      50014  FPL Energy Weatherford, LLC      56273
## 6      54707 Blue Canyon Windpower II LLC      56335
##                       Plant.Name State   County Generator.ID Status
## 1          Blue Canyon Windpower    OK Comanche           EW     OP
## 2    Oklahoma Wind Energy Center    OK Woodward         GE15     OP
## 3    Oklahoma Wind Energy Center    OK Woodward         GSOO     OP
## 4 Weatherford Wind Energy Center    OK   Custer            1     OP
## 5 Weatherford Wind Energy Center    OK   Custer            2     OP
## 6       Blue Canyon Windpower II    OK Comanche          EW2     OP
##             Technology Prime.Mover Sector.Name Sector
## 1 Onshore Wind Turbine          WT IPP Non-CHP      2
## 2 Onshore Wind Turbine          WT IPP Non-CHP      2
## 3 Onshore Wind Turbine          WT IPP Non-CHP      2
## 4 Onshore Wind Turbine          WT IPP Non-CHP      2
## 5 Onshore Wind Turbine          WT IPP Non-CHP      2
## 6 Onshore Wind Turbine          WT IPP Non-CHP      2
##   Nameplate.Capacity..MW. Summer.Capacity..MW. Winter.Capacity..MW.
## 1                    74.3                 74.3                 74.3
## 2                    51.0                 51.0                 51.0
## 3                    51.0                 51.0                 51.0
## 4                   106.5                106.5                106.5
## 5                    40.5                 40.5                 40.5
## 6                   151.0                151.0                151.0
##   Operating.Month Operating.Year Number.of.Turbines
## 1              12           2003                 45
## 2              10           2003                 34
## 3              10           2003                 34
## 4               4           2005                 71
## 5              12           2005                 27
## 6              12           2005                 84
##   Predominant.Turbine.Manufacturer Predominant.Turbine.Model.Number
## 1                           Vestas                         V82-1.65
## 2                               GE                            1.5 S
## 3                               GE                            1.5 S
## 4                               GE                          1.5 SLE
## 5                               GE                          1.5 SLE
## 6                           Vestas                          V80-1.8
##   Design.Wind.Speed..mph. Wind.Quality.Class Turbine.Hub.Height..Feet.
## 1                    19.0                  2                     262.0
## 2                    19.0                  2                     213.3
## 3                    19.0                  2                     213.3
## 4                    19.0                  2                     262.5
## 5                    19.0                  2                     262.5
## 6                    16.1                  2                     262.0

import PlantData

PlantData <- read.csv("~/PlantData.csv")
head(PlantData)
##   ï..Utility.ID        Utility.Name Plant.Code         Plant.Name
## 1           195    Alabama Power Co          2       Bankhead Dam
## 2           195    Alabama Power Co          3              Barry
## 3           195    Alabama Power Co          4 Walter Bouldin Dam
## 4           195    Alabama Power Co          7            Gadsden
## 5           195    Alabama Power Co          8             Gorgas
## 6          5701 El Paso Electric Co          9             Copper
##         Street.Address      City State   Zip     County Latitude
## 1   19001 Lock 17 Road Northport    AL 35476 Tuscaloosa 33.45867
## 2     North Highway 43     Bucks    AL 36512     Mobile 31.00690
## 3 750 Bouldin Dam Road  Wetumpka    AL 36092     Elmore 32.58389
## 4    1000 Goodyear Ave   Gadsden    AL 35903     Etowah 34.01280
## 5      460 Gorgas Road   Parrish    AL 35580     Walker 33.64434
## 6    651 Hawkins Blvd.   El Paso    TX 79915    El Paso 31.75690
##    Longitude NERC.Region Balancing.Authority.Code
## 1  -87.35682        SERC                     SOCO
## 2  -88.01030        SERC                     SOCO
## 3  -86.28306        SERC                     SOCO
## 4  -85.97080        SERC                     SOCO
## 5  -87.19649        SERC                     SOCO
## 6 -106.37500        WECC                      EPE
##                  Balancing.Authority.Name Name.of.Water.Source
## 1 Southern Company Services, Inc. - Trans  Black Warrior River
## 2 Southern Company Services, Inc. - Trans         Mobile River
## 3 Southern Company Services, Inc. - Trans          Coosa River
## 4 Southern Company Services, Inc. - Trans          Coosa River
## 5 Southern Company Services, Inc. - Trans        Warrior River
## 6                El Paso Electric Company         Municipality
##   Primary.Purpose..NAICS.Code. Regulatory.Status Sector      Sector.Name
## 1                           22                RE      1 Electric Utility
## 2                           22                RE      1 Electric Utility
## 3                           22                RE      1 Electric Utility
## 4                           22                RE      1 Electric Utility
## 5                           22                RE      1 Electric Utility
## 6                           22                RE      1 Electric Utility
##   FERC.Cogeneration.Status FERC.Cogeneration.Docket.Number
## 1                        N                                
## 2                        N                                
## 3                        N                                
## 4                        N                                
## 5                        N                                
## 6                        N                                
##   FERC.Small.Power.Producer.Status FERC.Small.Power.Producer.Docket.Number
## 1                                N                                        
## 2                                N                                        
## 3                                N                                        
## 4                                N                                        
## 5                                N                                        
## 6                                N                                        
##   FERC.Exempt.Wholesale.Generator.Status
## 1                                      N
## 2                                      N
## 3                                      N
## 4                                      N
## 5                                      N
## 6                                      N
##   FERC.Exempt.Wholesale.Generator.Docket.Number Ash.Impoundment.
## 1                                                              N
## 2                                                              Y
## 3                                                              N
## 4                                                              Y
## 5                                                              Y
## 6                                                               
##   Ash.Impoundment.Lined. Ash.Impoundment.Status
## 1                      X                       
## 2                      N                     OP
## 3                      X                       
## 4                      N                     OP
## 5                      N                     OP
## 6                      X                       
##   Transmission.or.Distribution.System.Owner
## 1                          Alabama Power Co
## 2                          Alabama Power Co
## 3                          Alabama Power Co
## 4                          Alabama Power Co
## 5                          Alabama Power Co
## 6                       El Paso Electric Co
##   Transmission.or.Distribution.System.Owner.ID
## 1                                          195
## 2                                          195
## 3                                          195
## 4                                          195
## 5                                          195
## 6                                         5701
##   Transmission.or.Distribution.System.Owner.State Grid.Voltage..kV.
## 1                                              AL               115
## 2                                              AL               230
## 3                                              AL               115
## 4                                              AL               115
## 5                                              AL               230
## 6                                              TX               115
##   Grid.Voltage.2..kV. Grid.Voltage.3..kV. Energy.Storage
## 1                  NA                  NA              N
## 2                  NA                  NA              N
## 3                  NA                  NA              N
## 4                  NA                  NA              N
## 5                  NA                  NA              N
## 6                  NA                  NA              N
##   Natural.Gas.LDC.Name    Natural.Gas.Pipeline.Name.1
## 1                                                    
## 2                                     BAY GAS STORAGE
## 3                                                    
## 4                        SOUTHERN NATURAL GAS COMPANY
## 5                                                    
## 6                      ONEOK WES TEX TRANSMISSION LLC
##   Natural.Gas.Pipeline.Name.2 Natural.Gas.Pipeline.Name.3 Pipeline.Notes
## 1                                                                       
## 2                                                                       
## 3                                                                       
## 4                                                                       
## 5                                                                       
## 6                                                                       
##   Natural.Gas.Storage Liquefied.Natural.Gas.Storage
## 1                                                  
## 2                   N                             X
## 3                                                  
## 4                   N                             X
## 5                                                  
## 6                   X                             X

get Oklahoma plant:

library(dplyr)
OklahomaPlant <- PlantData %>% 
  filter(State == "OK") 
OklahomaPlant <- edit(OklahomaPlant)
head(OklahomaPlant)
##   Utility.ID                       Utility.Name Plant.Code     Plant.Name
## 1       7490          Grand River Dam Authority        165           GREC
## 2      14077 Oklahoma Municipal Power Authority        762          Ponca
## 3      14063         Oklahoma Gas & Electric Co       2947       Arbuckle
## 4      14063         Oklahoma Gas & Electric Co       2950           Enid
## 5      14063         Oklahoma Gas & Electric Co       2951 Horseshoe Lake
## 6      14063         Oklahoma Gas & Electric Co       2952       Muskogee
##            Street.Address        City State   Zip   County Latitude
## 1           8142 Hwy 412B    Chouteau    OK 74337    Mayes 36.19028
## 2           1420 N. Union  Ponca City    OK 74601      Kay 36.71979
## 3                    <NA>        <NA>    OK 73086   Murray 34.51167
## 4 2318 Leona Mitchell Dr.        Enid    OK 73701 Garfield 36.37125
## 5    19801 NE 36th Street      Harrah    OK 73045 Oklahoma 35.50866
## 6   5501 Three Forks Road Fort Gibson    OK 74434 Muskogee 35.76135
##   Longitude NERC.Region Balancing.Authority.Code Balancing.Authority.Name
## 1 -95.28940         MRO                     SWPP     Southwest Power Pool
## 2 -97.08576         MRO                     SWPP     Southwest Power Pool
## 3 -96.97972         MRO                     SWPP     Southwest Power Pool
## 4 -97.87374         MRO                     SWPP     Southwest Power Pool
## 5 -97.17969         MRO                     SWPP     Southwest Power Pool
## 6 -95.28732         MRO                     SWPP     Southwest Power Pool
##   Name.of.Water.Source Primary.Purpose..NAICS.Code. Regulatory.Status
## 1         Grand Neosho                           22                RE
## 2         Municipality                           22                RE
## 3                Wells                           22                RE
## 4                                                22                RE
## 5       Horseshoe Lake                           22                RE
## 6       Arkansas River                           22                RE
##   Sector      Sector.Name FERC.Cogeneration.Status
## 1      1 Electric Utility                        N
## 2      1 Electric Utility                        N
## 3      1 Electric Utility                        N
## 4      1 Electric Utility                        N
## 5      1 Electric Utility                        N
## 6      1 Electric Utility                        N
##   FERC.Cogeneration.Docket.Number FERC.Small.Power.Producer.Status
## 1                                                                N
## 2                                                                N
## 3                                                                N
## 4                                                                N
## 5                                                                N
## 6                                                                N
##   FERC.Small.Power.Producer.Docket.Number
## 1                                        
## 2                                        
## 3                                        
## 4                                        
## 5                                        
## 6                                        
##   FERC.Exempt.Wholesale.Generator.Status
## 1                                      N
## 2                                      N
## 3                                      N
## 4                                      N
## 5                                      N
## 6                                      N
##   FERC.Exempt.Wholesale.Generator.Docket.Number Ash.Impoundment.
## 1                                                              N
## 2                                                              N
## 3                                                              N
## 4                                                              N
## 5                                                              N
## 6                                                              Y
##   Ash.Impoundment.Lined. Ash.Impoundment.Status
## 1                      X                       
## 2                      X                       
## 3                      X                       
## 4                      X                       
## 5                      X                       
## 6                      Y                     OS
##   Transmission.or.Distribution.System.Owner
## 1                 Grand River Dam Authority
## 2                 City of Ponca City - (OK)
## 3                                          
## 4                Oklahoma Gas & Electric Co
## 5                Oklahoma Gas & Electric Co
## 6                Oklahoma Gas & Electric Co
##   Transmission.or.Distribution.System.Owner.ID
## 1                                         7490
## 2                                        15202
## 3                                           NA
## 4                                        14063
## 5                                        14063
## 6                                        14063
##   Transmission.or.Distribution.System.Owner.State Grid.Voltage..kV.
## 1                                              OK               161
## 2                                              OK                69
## 3                                                                NA
## 4                                              OK                69
## 5                                              OK               138
## 6                                              OK               345
##   Grid.Voltage.2..kV. Grid.Voltage.3..kV. Energy.Storage
## 1                 345                  NA              N
## 2                  NA                  NA              N
## 3                  NA                  NA               
## 4                  NA                  NA               
## 5                  69                  NA              N
## 6                  NA                  NA              N
##      Natural.Gas.LDC.Name          Natural.Gas.Pipeline.Name.1
## 1                                  ENABLE GAS TRANSMISSION LLC
## 2 OKLAHOMA NATURAL GAS CO                                     
## 3                                                             
## 4                                                             
## 5                         ENABLE OKLAHOMA INTRASTATE TRANS LLC
## 6                         ENABLE OKLAHOMA INTRASTATE TRANS LLC
##   Natural.Gas.Pipeline.Name.2 Natural.Gas.Pipeline.Name.3 Pipeline.Notes
## 1                                                                       
## 2                                                                       
## 3                                                                       
## 4                                                                       
## 5                                                                       
## 6                                                                       
##   Natural.Gas.Storage Liquefied.Natural.Gas.Storage
## 1                   N                             X
## 2                   N                             X
## 3                                                  
## 4                                                  
## 5                   N                             X
## 6                   N                             X

import utility data

UtilityData <- read.csv("~/UtilityData.csv")
head(UtilityData)
##   ï..Utility.ID                         Utility.Name
## 1             7 Tate & Lyle Ingredients Americas Inc
## 2             8 Tate & Lyle Ingredients Americas Inc
## 3            21                  AES Shady Point LLC
## 4            25    Greenidge Generation Holdings LLC
## 5            34             City of Abbeville - (SC)
## 6            35               AES WR Ltd Partnership
##                Street.Address       City State   Zip
## 1   2200 East Eldorado Street    Decatur    IL 62525
## 2 2245 Sagamore Parkway North  Lafayette    IN 47904
## 3                P O Box 1740     Panama    OK 74951
## 4      PO Box 187590 Plant Rd    Dresden    NY 14441
## 5                 P O Box 639  Abbeville    SC 29620
## 6     11600 Mexico Farms Road Cumberland    MD 21502
##   Owner.of.Plants.Reported.on.Form. Operator.of.Plants.Reported.on.Form.
## 1                                 Y                                     
## 2                                 Y                                     
## 3                                 Y                                     
## 4                                 Y                                     
## 5                                 Y                                     
## 6                                 Y                                     
##   Asset.Manager.of.Plants.Reported.on.Form.
## 1                                          
## 2                                          
## 3                                          
## 4                                          
## 5                                          
## 6                                          
##   Other.Relationships.with.Plants.Reported.on.Form. Entity.Type
## 1                                                           IND
## 2                                                           IND
## 3                                                             Q
## 4                                                             Q
## 5                                                             M
## 6                                                             Q

get Oklahoma utility data:

library(dplyr)
OklahomaUtility <- UtilityData %>% 
  filter(State == "OK") 
OklahomaUtility <- edit(OklahomaUtility)
head(OklahomaUtility)
##   Utility.ID                            Utility.Name
## 1         21                     AES Shady Point LLC
## 2       1881               Blue Canyon Windpower LLC
## 3       2897                         Oneta Power LLC
## 4       4667                  City of Cushing - (OK)
## 5       5199              Devon Energy Production Co
## 6       6589 Georgia-Pacific Consumer Operations LLC
##                  Street.Address          City State   Zip
## 1                  P O Box 1740        Panama    OK 74951
## 2            Route 2, Box 484-1      Carnegie    OK 73015
## 3 25142 East 105th Street South  Broken Arrow    OK 74014
## 4                   P O Box 311       Cushing    OK 74023
## 5             333 West Sheridan Oklahoma City    OK 73102
## 6          4901 E Chandler Road      Muskogee    OK 74403
##   Owner.of.Plants.Reported.on.Form. Operator.of.Plants.Reported.on.Form.
## 1                                 Y                                     
## 2                                 Y                                     
## 3                                                                      Y
## 4                                 Y                                     
## 5                                 Y                                     
## 6                                 Y                                     
##   Asset.Manager.of.Plants.Reported.on.Form.
## 1                                          
## 2                                          
## 3                                          
## 4                                          
## 5                                          
## 6                                          
##   Other.Relationships.with.Plants.Reported.on.Form. Entity.Type
## 1                                                             Q
## 2                                                             Q
## 3                                                             Q
## 4                                                             M
## 5                                                           IND
## 6                                                           IND

put it all together

#make fields match
OklahomaGeneration$Utility.ID <- as.integer(OklahomaGeneration$Utility.ID)
OklahomaEnergyDatabase <- full_join(OklahomaGeneration, OklahomaWind, by = "Utility.ID")

#OklahomaPlant$Utility.ID <- as.integer(OklahomaPlant$Utility.ID)
OklahomaEnergyDatabase <- full_join(OklahomaEnergyDatabase, OklahomaPlant, by = "Utility.ID")

#Oklahoma <- as.integer(OklahomaPlant$Utility.ID)
OklahomaEnergyDatabase <- full_join(OklahomaEnergyDatabase, OklahomaUtility, by = "Utility.ID")

export data

write.csv(OklahomaEnergyDatabase,'C:\\Users\\Owner\\Desktop\\OklahomaEnergyData.csv', row.names = FALSE)