diff --git a/myFirstRMarkdown.Rmd b/myFirstRMarkdown.Rmd index a9c8bd6e862e30da4d01055978e88d14950af789..651bd4078846210489c65ac37a12cea33856b979 100644 --- a/myFirstRMarkdown.Rmd +++ b/myFirstRMarkdown.Rmd @@ -75,12 +75,13 @@ plotDT <- generationDT[, keyby = .(Time_Period, rDate, Fuel_Code)] # > Use the new data to draw a chart of all generation in the data ---- -myCaption <- "Source: January 2018 wholesale generation data via EMI (NZ Electricity Authority)" +myCaption <- "Source: December 2017 wholesale generation data via EMI (NZ Electricity Authority)" ggplot(plotDT, aes(x = Time_Period, y = totalMW, colour = as.factor(rDate), group = rDate)) + geom_point() + facet_grid(Fuel_Code ~ .) + - labs(caption = myCaption) + labs(caption = myCaption, y = "MW", x = "Half hour") + + theme(legend.title=element_blank()) ``` @@ -94,7 +95,11 @@ plotDT <- plotDT[, pcTotalMW := 100*(totalMW/sumAllMW)] # calculate % # > Use the new data to draw a chart of hydro as a % of all during Christmas week ---- ggplot(plotDT[Fuel_Code == "Hydro"], aes(x = Time_Period, y = pcTotalMW, colour = as.factor(rDate), group = rDate)) + - geom_line() + geom_line() + + labs(caption = myCaption, + y = "% of total generation", + x = "Half hour") + + theme(legend.title=element_blank()) ``` # Discuss your results diff --git a/myFirstRMarkdown.html b/myFirstRMarkdown.html index 143dd46aa0c038f561bac7cbf914e86cb84876ee..3b32cc4e95463510f11f28676ae737a6996377b5 100644 --- a/myFirstRMarkdown.html +++ b/myFirstRMarkdown.html @@ -218,7 +218,7 @@ div.tocify { <h1 class="title toc-ignore">myFirstRMarkdown</h1> <h4 class="author"><em>Ben Anderson (<a href="mailto:b.anderson@soton.ac.uk">b.anderson@soton.ac.uk</a> <code>@dataknut</code>)</em></h4> -<h4 class="date"><em>Last run at: 2018-03-29 14:45:15</em></h4> +<h4 class="date"><em>Last run at: 2018-03-29 14:57:58</em></h4> </div> @@ -407,7 +407,11 @@ plotDT <- plotDT[, pcTotalMW := 100*(totalMW/sumAllMW)] # calculate % # > Use the new data to draw a chart of hydro as a % of all during Christmas week ---- ggplot(plotDT[Fuel_Code == "Hydro"], aes(x = Time_Period, y = pcTotalMW, colour = as.factor(rDate), group = rDate)) + - geom_line()</code></pre> + geom_line() + + labs(caption = myCaption, + y = "% of total generation", + x = "Half hour") + + theme(legend.title=element_blank())</code></pre> <pre><code>## Warning: Removed 62 rows containing missing values (geom_path).</code></pre> <div class="figure"> <img src="myFirstRMarkdown_files/figure-html/hydro%20as%20percent%20chart-1.png" alt="Plot hydro as a % of all generation by date and time period" /> diff --git a/myFirstRMarkdown.md b/myFirstRMarkdown.md index 3af4b9825214e2f3e4110ac1c3640596c25570ec..68a2ee2e6279f9982ba96f3f3ab2bb375081820c 100644 --- a/myFirstRMarkdown.md +++ b/myFirstRMarkdown.md @@ -1,7 +1,7 @@ --- title: "myFirstRMarkdown" author: "Ben Anderson (b.anderson@soton.ac.uk `@dataknut`)" -date: 'Last run at: 2018-03-29 14:45:15' +date: 'Last run at: 2018-03-29 14:57:58' output: html_document: fig_caption: yes @@ -131,7 +131,11 @@ plotDT <- plotDT[, pcTotalMW := 100*(totalMW/sumAllMW)] # calculate % # > Use the new data to draw a chart of hydro as a % of all during Christmas week ---- ggplot(plotDT[Fuel_Code == "Hydro"], aes(x = Time_Period, y = pcTotalMW, colour = as.factor(rDate), group = rDate)) + - geom_line() + geom_line() + + labs(caption = myCaption, + y = "% of total generation", + x = "Half hour") + + theme(legend.title=element_blank()) ``` ``` diff --git a/myFirstRMarkdown_files/figure-html/hydro as percent chart-1.png b/myFirstRMarkdown_files/figure-html/hydro as percent chart-1.png index daffdaf4a8980c30ded78d7b7f1c6cc5e5caf332..87ca75d8bc75ada067424a27d575ec5f2ecd879c 100644 Binary files a/myFirstRMarkdown_files/figure-html/hydro as percent chart-1.png and b/myFirstRMarkdown_files/figure-html/hydro as percent chart-1.png differ diff --git a/myFirstRMarkdown_files/figure-html/plot1-1.png b/myFirstRMarkdown_files/figure-html/plot1-1.png index 92d9b5aedd67f13e438270c7b1e6a394fc4ea77d..c351bacbf3fd651dc138aab1aaca0886fad65253 100644 Binary files a/myFirstRMarkdown_files/figure-html/plot1-1.png and b/myFirstRMarkdown_files/figure-html/plot1-1.png differ