R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Three group_by() data frames

energy %>%

group_by(`Country Name`) %>%

summarise(Max_renewable_energy_output_GWh = max(`Renewable electricity output (GWh)`))

#Max total electricity output (Gwh) by country

energy %>%

group_by(`Country Name`) %>%

summarise(total_electricity_output = max(`Total electricity output (GWh) `))

#Max final energy consumption by year

energy %>%

group_by(`Year`) %>%

summarise(`Energy Consumption` = max(`Total final energy consumption (TFEC) (TJ) ` ))

library(ggplot2)

#energy <- read_delim("./590_FinalData1.csv", delim = ",")
#view(energy)
#Max total electricity output (Gwh) by country
# energy %>% 
#   group_by(`Country Name`) %>%
#   summarise(Max_renewable_energy_output_GWh = max(`Renewable electricity output (GWh)`))
# 
# #Max total electricity output (Gwh) by country
# energy %>% 
#   group_by(`Country Name`) %>% 
#   summarise(total_electricity_output = max(`Total electricity output (GWh) `))
# 
# #Max final energy consumption by year
# energy %>% 
#   group_by(`Year`) %>% 
#   summarise(`Energy Consumption` = max(`Total final energy consumption (TFEC) (TJ) ` ))

Max total electricity output (Gwh) by country:
The highest number of renewable electricity output tells us the most renewable electricity each country has output from 1990 to 2016. I assume that these max values are coming from more recent years because of technological advances. If this were a percentage though where we are concerned with percent of renewable energy compared to total energy consumption, we might see a different result because of more people gaining access to tech, but not necessarily renewable sources.

Max total electricity output (Gwh) by country:

This tells us the most amount of energy consumed per country in one year. Most countries that have a high rural population or smaller population in general are likely to be lower than any other country on the list because of a lack of electricity access.

Max final energy consumption by year:

The most amount of energy used by a country per year is represented in this summary. I would hypothesize that energy consumption increases as total population increases. Knowing the max amount of energy consumed will give us an idea for the rate at which we consume energy or time periods that used significantly more or less energy per year.

2-3 categorical variables I know all possible combinations for: