diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.Rmd b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.Rmd index b08badf9a673491c8dc357c3db18682bbfe9232f..5c064108a4998a4dca3bf27e566b20413475916a 100644 --- a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.Rmd +++ b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.Rmd @@ -23,8 +23,8 @@ knitr::opts_chunk$set(echo = FALSE) # do not echo code knitr::opts_chunk$set(warning = FALSE) knitr::opts_chunk$set(message = FALSE) knitr::opts_chunk$set(fig_caption = TRUE) -knitr::opts_chunk$set(fig_height = 6) # default, make it bigger to stretch vertical axis -knitr::opts_chunk$set(fig_width = 8) # full width +#knitr::opts_chunk$set(fig_height = 6) # default, make it bigger to stretch vertical axis +#knitr::opts_chunk$set(fig_width = 8) # full width knitr::opts_chunk$set(tidy = TRUE) # tidy up code in case echo = TRUE ``` @@ -715,7 +715,6 @@ The following chart extends this analysis to time of day by showing the weighted ```{r plot weighted vs unweighted} - # aggregate to wday only # unweighted counts aggHhDemandActsDT <- hhDemandActsDT[, .(anyHHmain = sum(anyHHmain)), @@ -849,9 +848,9 @@ myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (%, weighted)" ba_createStackedPlot(aggHhDemandActsWtDT, yVar = "pcAnyHHMainWt", fillVar = "actLabel", yLabel = "% halfhours (main act)", facetVars = "ba_survey ~ r_wday") ``` -Compare in home & out of home but without looking at day of the week (paper Fig 1). +Compare in home & out of home but without looking at day of the week (paper Fig 1). Adjust height of chart to fit single A4 page? -```{r repeat all acts but split by at home vs not at home} +```{r repeat all acts but split by at home vs not at home, fig.height=10, fig.width=8} # this requires creating a new aggregated table # weighted counts @@ -889,9 +888,9 @@ myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (%, weighted)" ba_createGreyStackedPlot(plotDT, yVar = "pcAnyHHMainWt", fillVar = "actLabel", yLabel = "% halfhours (main act)", facetVars = "ba_survey ~ inHome") ``` -Now plot % point change ignoring day of the week (paper Fig 2) +Now plot % point change ignoring day of the week (paper Fig 2, adjust height & width to suit single A4) -```{r pc point change all days} +```{r pc point change all days, fig.height=10, fig.width=8} dt1974WtDT <- plotDT[ba_survey == "1974"] dt1974WtDT <- dt1974WtDT[, pcAnyHHMainWt.1974 := pcAnyHHMainWt] dt2014WtDT <- plotDT[ba_survey == "2014"] @@ -918,7 +917,7 @@ myPlot <- ba_plotChange(dtChange1974_2014WtDT[as.POSIXlt(r_startHalfHour)$hour > myPlot ``` -Next we separate out 'in home' vs 'not in home' activities (as reported). +Next we separate out 'in home' vs 'not in home' activities (as reported) - Fig 3. ```{r repeat all acts but split by day of week and at home vs not at home} @@ -965,10 +964,12 @@ ba_createStackedPlot(aggHhDemandActsInHomeWtDT[inHome == "At own home"], yVar = As the above representation is difficult to interpret, we next present a derived graph which shows the change in % of halfhours in which these activities were recorded from 1974 to 2014. This chart therefore shows aboslute change of percentage points and highlights those relatively frequent activities which have changed a lot. +Fig 3 + > NB: ignores hours < 06:00 to avoid noisy data -```{r all - plot pc change 1974_2014} +```{r all - plot pc change 1974_2014, fig.height=10, fig.width=8} # re-use dt from above @@ -1236,9 +1237,9 @@ dtChange1974_2014_workingAgeWtDT <- dtChange1974_2014_workingAgeWtDT[, deltaMain ``` -Out of home: +Out of home: Fig 4 -```{r 16-64 - plot day of week change for 1974 - 2014 out of home} +```{r 16-64 - plot day of week change for 1974 - 2014 out of home, fig.height=10, fig.width=8} myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, Not at own home)" ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome != "At own home"], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing) @@ -1261,9 +1262,9 @@ ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome != "At own home" & ``` -At home: +At home: Fig 5 -```{r 16-64 - plot day of week change for 1974 - 2014 at own home} +```{r 16-64 - plot day of week change for 1974 - 2014 at own home, fig.height=10, fig.width=8} myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, At own home)" myPlot <- ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome == "At own home"], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing) diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.html b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.html index 8f51cf28cf6c0ba708d5be62b7b5a0fa35876574..93e0fbb1b985215387c499e0445dbcce3216eb2a 100644 --- a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.html +++ b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.html @@ -218,7 +218,7 @@ div.tocify { <h1 class="title toc-ignore">The Changing Nature of Peak Demand in the UK: 1974 - 2014</h1> <h4 class="author"><em>Ben Anderson (<a href="mailto:b.anderson@soton.ac.uk">b.anderson@soton.ac.uk</a>, <code>@dataknut</code>), Jacopo Torriti (<a href="mailto:j.torriti@reading.ac.uk">j.torriti@reading.ac.uk</a>, <code>@JTorriti</code>)</em></h4> -<h4 class="date"><em>Last run: 2018-01-19 01:21:52</em></h4> +<h4 class="date"><em>Last run: 2018-01-22 23:25:21</em></h4> </div> @@ -2628,16 +2628,17 @@ div.tocify { <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/plot%20DEMAND%20acts%20(stacked)-1.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/plot%20DEMAND%20acts%20(stacked)-2.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/plot%20DEMAND%20acts%20(stacked)-3.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/plot%20DEMAND%20acts%20(stacked)-4.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/plot%20DEMAND%20acts%20(stacked)-5.png" /><!-- --></p> <p>Finally we plot all years combined.</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all%20years%20stacked-1.png" /><!-- --></p> -<p>Compare in home & out of home but without looking at day of the week (paper Fig 1).</p> +<p>Compare in home & out of home but without looking at day of the week (paper Fig 1). Adjust height of chart to fit single A4 page?</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat%20all%20acts%20but%20split%20by%20at%20home%20vs%20not%20at%20home-1.png" /><!-- --></p> -<p>Now plot % point change ignoring day of the week (paper Fig 2)</p> +<p>Now plot % point change ignoring day of the week (paper Fig 2, adjust height & width to suit single A4)</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc%20point%20change%20all%20days-1.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc%20point%20change%20all%20days-2.png" /><!-- --></p> -<p>Next we separate out ‘in home’ vs ‘not in home’ activities (as reported).</p> +<p>Next we separate out ‘in home’ vs ‘not in home’ activities (as reported) - Fig 3.</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat%20all%20acts%20but%20split%20by%20day%20of%20week%20and%20at%20home%20vs%20not%20at%20home-1.png" /><!-- --><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat%20all%20acts%20but%20split%20by%20day%20of%20week%20and%20at%20home%20vs%20not%20at%20home-2.png" /><!-- --></p> <blockquote> <p>2nd acts not useful</p> </blockquote> <p>As the above representation is difficult to interpret, we next present a derived graph which shows the change in % of halfhours in which these activities were recorded from 1974 to 2014. This chart therefore shows aboslute change of percentage points and highlights those relatively frequent activities which have changed a lot.</p> +<p>Fig 3</p> <blockquote> <p>NB: ignores hours < 06:00 to avoid noisy data</p> </blockquote> @@ -2983,12 +2984,12 @@ div.tocify { <blockquote> <p>NB: ignores hours < 06:00 to avoid noisy data</p> </blockquote> -<p>Out of home:</p> +<p>Out of home: Fig 4</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64%20-%20plot%20day%20of%20week%20change%20for%201974%20-%202014%20out%20of%20home-1.png" /><!-- --></p> <p>Essentially repeat the above analysis but for evening peak.</p> <p>Out of home evening peak:</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64%20-%20plot%20day%20of%20week%20change%20for%201974%20-%202014%20out%20of%20home%20evening%20peak-1.png" /><!-- --></p> -<p>At home:</p> +<p>At home: Fig 5</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64%20-%20plot%20day%20of%20week%20change%20for%201974%20-%202014%20at%20own%20home-1.png" /><!-- --></p> <p>At home evening peak</p> <p><img src="changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64%20-%20plot%20day%20of%20week%20change%20for%201974%20-%202014%20at%20own%20home%20evening%20peak-1.png" /><!-- --></p> @@ -4684,7 +4685,7 @@ Observations </div> <div id="about" class="section level1"> <h1><span class="header-section-number">12</span> About</h1> -<p>Analysis completed in: 12.097 seconds using <a href="https://cran.r-project.org/package=knitr">knitr</a> with R version 3.4.2 (2017-09-28) running on x86_64-apple-darwin15.6.0.</p> +<p>Analysis completed in: 5.817 seconds using <a href="https://cran.r-project.org/package=knitr">knitr</a> with R version 3.4.2 (2017-09-28) running on x86_64-apple-darwin15.6.0.</p> <p>R packages used:</p> <ul> <li>base R - for the basics <span class="citation">[@baseR]</span></li> diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.md b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.md index 1918c67a11c0f73619fbb734f2b41a34c3d74d6a..dc6e5117cad763f231219e28b510f40a19c64dab 100644 --- a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.md +++ b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0.md @@ -1,7 +1,7 @@ --- title: "The Changing Nature of Peak Demand in the UK: 1974 - 2014" author: "Ben Anderson (b.anderson@soton.ac.uk, `@dataknut`), Jacopo Torriti (j.torriti@reading.ac.uk, `@JTorriti`)" -date: 'Last run: 2018-01-19 01:21:52' +date: 'Last run: 2018-01-22 23:25:21' output: html_document: fig_caption: yes @@ -580,15 +580,15 @@ Finally we plot all years combined. <!-- --> -Compare in home & out of home but without looking at day of the week (paper Fig 1). +Compare in home & out of home but without looking at day of the week (paper Fig 1). Adjust height of chart to fit single A4 page? <!-- --> -Now plot % point change ignoring day of the week (paper Fig 2) +Now plot % point change ignoring day of the week (paper Fig 2, adjust height & width to suit single A4) <!-- --><!-- --> -Next we separate out 'in home' vs 'not in home' activities (as reported). +Next we separate out 'in home' vs 'not in home' activities (as reported) - Fig 3. <!-- --><!-- --> @@ -596,6 +596,8 @@ Next we separate out 'in home' vs 'not in home' activities (as reported). As the above representation is difficult to interpret, we next present a derived graph which shows the change in % of halfhours in which these activities were recorded from 1974 to 2014. This chart therefore shows aboslute change of percentage points and highlights those relatively frequent activities which have changed a lot. +Fig 3 + > NB: ignores hours < 06:00 to avoid noisy data @@ -709,7 +711,7 @@ We run the 'whole day' and 'eveing peak' analysis in direct sequence as one is j -Out of home: +Out of home: Fig 4 <!-- --> @@ -720,7 +722,7 @@ Out of home evening peak: <!-- --> -At home: +At home: Fig 5 <!-- --> @@ -1110,7 +1112,7 @@ If you wish to cite this work please use: # About -Analysis completed in: 12.097 seconds using [knitr](https://cran.r-project.org/package=knitr) with R version 3.4.2 (2017-09-28) running on x86_64-apple-darwin15.6.0. +Analysis completed in: 5.817 seconds using [knitr](https://cran.r-project.org/package=knitr) with R version 3.4.2 (2017-09-28) running on x86_64-apple-darwin15.6.0. R packages used: diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 at own home-1.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 at own home-1.png index 0c55622502db1d8a82de48f97f7b4fba3e1d7285..24eca579d94de20ecbfdaa54df24a4dc6678ceb1 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 at own home-1.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 at own home-1.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 out of home-1.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 out of home-1.png index 459788b9c92a950cbcecd3adc77c87a132ddda2e..d269a490f4a36044d7a28419a848add833f629a1 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 out of home-1.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/16-64 - plot day of week change for 1974 - 2014 out of home-1.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-1.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-1.png index d7ce6aae55dfb2731b30d4e45e928f33b029bfd6..d5d01f7cba34c5fc90b6609111b3b894157fba26 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-1.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-1.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-2.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-2.png index c39d16e9516064d37e15c48131172321e82b9aa2..b863b8501fbc627031095d6a710b905e31fb6925 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-2.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-2.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-3.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-3.png index de0090653c32c069de2ea487cda32ffcc029ae10..4d3b9a39a4f8dba2dd6bcb966ab299023709578e 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-3.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/all - plot pc change 1974_2014-3.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-1.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-1.png index 67e994b493942de1595692e9d940abb0bf8aaecf..a37c81c9ded11e9cabc50718acaaa38ea8b1a12f 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-1.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-1.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-2.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-2.png index db485f176cf399d39860a5c6a868cd01b33c8028..a0955f825ea0820dea3c46ce2bebb074417034de 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-2.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/pc point change all days-2.png differ diff --git a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat all acts but split by at home vs not at home-1.png b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat all acts but split by at home vs not at home-1.png index 16324a0518e335f62023a94c8d886811e1f31cc8..d5f4f00a384713baa9f9ab6454569c0d9b9959c7 100644 Binary files a/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat all acts but split by at home vs not at home-1.png and b/Theme-1/changeOverTime/changingPeakDemandMtus1974_2014_v2.0_files/figure-html/repeat all acts but split by at home vs not at home-1.png differ