Skip to content
Snippets Groups Projects
Commit 56997b62 authored by Ben Anderson's avatar Ben Anderson
Browse files

amended bibliography & re-run

parent ca85c0cb
Branches
No related tags found
No related merge requests found
--- ---
title: "MTUS World 6 Data Processing" title: "MTUS World 6 Data Processing"
author: "Ben Anderson" author: "Ben Anderson (b.anderson@soton.ac.uk/@dataknut)"
date: "(b.anderson@soton.ac.uk, @dataknut)" date: 'Last run at: `r Sys.time()`'
output: output:
pdf_document: pdf_document:
toc: yes toc: yes
...@@ -13,6 +13,7 @@ output: ...@@ -13,6 +13,7 @@ output:
theme: journal theme: journal
toc: yes toc: yes
toc_depth: 3 toc_depth: 3
bibliography: ~/bibliography.bib
--- ---
```{r setupKnitr, include=FALSE} ```{r setupKnitr, include=FALSE}
...@@ -24,20 +25,25 @@ knitr::opts_chunk$set(fig_caption = TRUE) ...@@ -24,20 +25,25 @@ knitr::opts_chunk$set(fig_caption = TRUE)
knitr::opts_chunk$set(tidy = TRUE) knitr::opts_chunk$set(tidy = TRUE)
``` ```
# About this document # Introduction
Document last refreshed: `r Sys.time()` Purpose:
This document was created using [knitr](https://cran.r-project.org/package=knitr) in [RStudio](http://www.rstudio.com). Knitr supports the embedding of R statistical analysis code within markdown text documents allowing them to be updated and re-run. Things to note: * To process the MTUS World 6 episode data
* To save a processed & gzipped .csv file containing data for just the UK.
Data:
* Depending on the options set Knitr will display warnings (but not errors) from R. The warnings may or may not be important to the interpretation of the results; * MTUS [World 6](http://www.timeuse.org/mtus) - episodes file
* Knitr is very clever but it does not always support pretty tables.
This work was funded by RCUK through the End User Energy Demand Centres Programme via the "DEMAND: Dynamics of Energy, Mobility and Demand" Centre: This work was funded by RCUK through the End User Energy Demand Centres Programme via the "DEMAND: Dynamics of Energy, Mobility and Demand" Centre:
* http://www.demand.ac.uk * http://www.demand.ac.uk
* http://gow.epsrc.ac.uk/NGBOViewGrant.aspx?GrantRef=EP/K011723/1 * http://gow.epsrc.ac.uk/NGBOViewGrant.aspx?GrantRef=EP/K011723/1
Code:
* https://github.com/dataknut/MTUS
`License:` `License:`
`The R code embedded in this document is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License (http://choosealicense.com/licenses/gpl-2.0/), or (at your option) any later version.` `The R code embedded in this document is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License (http://choosealicense.com/licenses/gpl-2.0/), or (at your option) any later version.`
...@@ -46,8 +52,16 @@ This work was funded by RCUK through the End User Energy Demand Centres Programm ...@@ -46,8 +52,16 @@ This work was funded by RCUK through the End User Energy Demand Centres Programm
>YMMV - http://en.wiktionary.org/wiki/YMMV >YMMV - http://en.wiktionary.org/wiki/YMMV
*** # Set up R environment
Key packages used:
* base R - for the basics [@baseR]
* foreign - for loading SPSS data [@foreign]
* data.table - for fast (big) data handling [@data.table]
* knitr - to create this document [@knitr]
* dplyr & dtplyr - for data manipulation [@dplyr][@dtplyr]
````{r houseKeeping} ````{r houseKeeping}
# Clear out all old objects etc ---- # Clear out all old objects etc ----
# to avoid confusion # to avoid confusion
...@@ -57,15 +71,12 @@ rm(list = ls()) ...@@ -57,15 +71,12 @@ rm(list = ls())
starttime <- Sys.time() starttime <- Sys.time()
# Load required packages ---- # Load required packages ----
packs <- c("ggplot2", # slick & easy graphs packs <- c("foreign", # loading SPSS/STATA
"foreign", # loading SPSS/STATA
"data.table", # fast data manipulation "data.table", # fast data manipulation
"gmodels", # for table proportions "dplyr", # data manipulation
"knitr", # for kable "dtplyr", # data table & dplyr code
"profvis", # profiling code visualisations "knitr" # for kable
"dplyr" # data transformation
) )
# xtable - not useful: outputs latex only ----
# do this to install them if needed # do this to install them if needed
# install.packages(x) # install.packages(x)
...@@ -84,16 +95,6 @@ episodesFile <- "MTUS-adult-episode.sav" ...@@ -84,16 +95,6 @@ episodesFile <- "MTUS-adult-episode.sav"
efile <- paste0(mtusPath, episodesFile) efile <- paste0(mtusPath, episodesFile)
```` ````
# Introduction
Purpose:
* To process the MTUS World 6 episode data (`r episodesFile`)
* To save a processed & gzipped .csv file containing data for just the UK.
Data:
* MTUS [World 6](http://www.timeuse.org/mtus) - episodes file
# Load and process episodes file # Load and process episodes file
Loading and processing `r efile`. Loading and processing `r efile`.
...@@ -840,5 +841,4 @@ kable( ...@@ -840,5 +841,4 @@ kable(
__Meta:__ __Meta:__
Analysis completed in: `r round(Sys.time() - starttime, 3)` seconds using [knitr](https://cran.r-project.org/package=knitr) in [RStudio](http://www.rstudio.com). Analysis completed in: `r round(Sys.time() - starttime, 3)` seconds using [knitr](https://cran.r-project.org/package=knitr) in [RStudio](http://www.rstudio.com).
*** # References
__Footnotes:__
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment