library(ggplot2)
library(tidyr)
energy <- read.csv(file="energy.csv")
new_energy<-energy %>% gather(source,amount,coal,naturalgas,petroleum,nuclear,renewables)
ggplot(new_energy, aes(x=Year, y=amount, group=source, fill = source)) +
geom_line() +
geom_area(position = 'stack')

ggplot(new_energy, aes(x=Year, y=amount, group=source, color = source)) +
geom_line() +
facet_grid(source~.)

scale_x_continuous(breaks=c(2014,2015))
## <ScaleContinuousPosition>
## Range:
## Limits: 0 -- 1
ggplot(new_energy, aes(x=Year, y=amount, group=source, color = source)) +
geom_line()

scale_x_continuous(breaks=c(2014,2015))
## <ScaleContinuousPosition>
## Range:
## Limits: 0 -- 1