class: inverse, center, title-slide, middle <style> .title-slide .remark-slide-number { display: none; } </style> # Thesis study + Q and A ### Andy MacLachlan ### 14/04/2021 (updated: 06/05/2021)
[a.maclachlan@ucl.ac.uk](mailto:a.maclachlan@ucl.ac.uk)
[andymaclachlan](https://twitter.com/andymaclachlan)
[andrewmaclachlan](https://github.com/andrewmaclachlan)
[Centre for Advanced Spatial Analysis, UCL](https://www.ucl.ac.uk/bartlett/casa/) <a href="https://github.com/andrewmaclachlan" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#fff; color:#151513; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> --- class: inverse, center, middle  --- class: inverse, center, middle # Possible headings --- # Headings - Introduction Usually very few headings - Introduction - Research question - Objectives - Thesis outline --- class: inverse, center, middle # Introduction = clearly show the **research gap** that will be expanded on in the literature review --- #Literature review Depends on the topic, but usually some commonalities: -- .pull-left[ Can features of the built environment be used to predict the locations of pedestrian crashes at the street level in Uptown Charlotte, North Carolina? * Benefits of Walking * Pedestrian Safety Pandemic * Pedestrian Policies, Globally and Locally * Factors Influencing Pedestrian Safety * Pedestrian Data Dilemmas * Methods for Considering Pedestrian Safety ] -- .pull-right[ to determine how to prioritize road segments for investments in segregated cycling infrastructure, doing so in a way that makes optimal use of limited budgets - What Effects the Decision to Cycle - Existence of Segregated Cycling Infrastructure - Directness - Continuity and Density - Overarching Policies - Planning Cycling Networks - Connected Components - Optimization - Directness - Optimization based on Community Detection - Underlying Ethical Principles ] --- # Literature review common headings You will have you research topic BUT what are the policies, studies or data that surround it: -- * What effects it? -- * Who decided that it is this way? What was it based on? -- * How is it defined? Do definitions vary based on location or other factors? -- * How is that measured? -- * How has it been studied before? -- You will likely have a 2 or 3 main headings within the literature review and sub headings exploring specifics under them --- class: inverse, center, middle # Literature review = what you are contributing (towards the end of the literature review), based on what has been done #+ Novel: What is new? --- # Methdology headings - study area Start with a high level overview **Do you need a study area chapter or section within the methodology** -- * Is your study area unique -- * Are you trying to address a specific policy or metropolitan challenge that is associated with that city -- * Does it have a history of trying to solve the issue or failures in attempting to address it -- * Is there certain or specific data for your city? -- * Has there been a sudden local interest from policy -- * e.g.: Charlotte WALKS Pedestrian Plan, The London Plan -- You probably don't need one if you are creating a method --- # Methodology headings .pull-left[ Think logically, a reader needs to know: * What data you have access to / used * Any data processing you have done * Any ethical concerns about the data * What method(s) you will use * How you use both together ] -- .pull-right[ * Study Area * Data * Ethical evaluation (mostly focus on data) * Methodological Overview * Random forest * Negative Binomial Regression * Prediction and Interpretation ] --- # Results headings Some dissertations don't have any sub headings. Others do... An easy way to have sub headings here is to adapt your objectives ... that usually focus on data results **or** look back at your literature review headings -- .pull-left[ * OD Pair Performance * Potential Cycling Demand * Routing * Prioritizing Road Segments for Segregated Infrastructure * Algorithm 1: Growth From One Origin * Algorithm 2: Utilitarian Growth * Algorithm 3: Egalitarian Growth (Focus on Fair Distribution of Resources) * Connectivity ] -- .pull-right[ - What Effects the Decision to Cycle - Existence of Segregated Cycling Infrastructure - Directness - Continuity and Density - Overarching Policies - Planning Cycling Networks - Connected Components - Optimization - Directness - Optimization based on Community Detection - Underlying Ethical Principles ] -- Other students who have developed a model have then applied it to different areas with a sub section for each in the results section. --- class: inverse, center, middle # The discussion is the *most* important part of your thesis --- # Discussion headings An easy way to do this...again look back at your research question and objectives, can you form sub headings from them. Some past students did exactly this... .pull-left[ * Interpretation of Model * Assessment of Variables * The Need for Pedestrian Volume Data * Pedestrian Safety Policy Contextualization * Limitations] -- .pull-right[ * What features of the built environment are thought to influence pedestrian safety, and can our understanding of these relationships be strengthened? * What are the challenges when it comes to studying pedestrian safety in terms of the lack of available pedestrian data? Does Charlotte collect and make public the data required for this type of analysis? * How can the findings of this research be used to improve upon existing policy or urban design strategies by highlighting targeted areas and adjustments for improved pedestrian safety? ] --- # Remember the funnel * Start discussing you results in relation to literature * Build outwards to specific policy recommendations * Frame them within limitations --- class: inverse, center, middle # A discussion **does NOT JUST** talk about results and is **NOT JUST** limitations --- # Discussion headings An easy way to do this...again look back at your research question and objectives, can you form sub headings from them. Some past students did exactly this... .pull-left[ * Potential Cycling Demand * Routing * Community Detection * Algorithms ] -- .pull-right[ - What Effects the Decision to Cycle - Existence of Segregated Cycling Infrastructure - Directness - Continuity and Density - Overarching Policies - Planning Cycling Networks - Connected Components - Optimization - Directness - Optimization based on Community Detection - Underlying Ethical Principles ] --- # Discussion - other headings to consider These could from sub sub headings based on other sections and vary on research: -- * Research significance = **NOVEL** -- * Global development goals -- * Local policy -- * Academic research -- * Transferability --- class: inverse, center, middle # Conclusion vs abstract  --- # The Abstact The abstract is always much shorter and can be created by following a few simple steps: .pull-left[ * State what challenge you are trying to solve, perhaps with a sentence or two of context before it. * State what method you use * State what the results show * State what the paper recommends based on the data ] -- .pull-right[ * Through global and local policies, improved walkability and pedestrian safety are being promoted as important transportation objectives * This study used the methodology proposed by ... * The results show that current, city-wide pedestrian safety policies may not be helpful * This paper advocates for enhanced pedestrian count programs in Charlotte ..[a bit vague] ] --- # The Conclusion The conclusion is longer and should reflect on if the aim(s) and objectives were met. It is similar to the abstract but has much more detail. .pull-left[ * restate what you set out to investigate * summarise how you achieved the * summarise the results * reflect if you meet the aims + objectives * state the importance * give some high level, specifc, recommendations] -- .pull-right[ * This research employs a comparative case study approach to investigate data production and maintenance in humanitarian mapping campaigns * The recently developed OSHDB API (Raifer et al. 2019) was applied to efficiently process * This finding suggests that the OSM data in these areas is at a greater risk of becoming out of date * It is hoped that this work will serve as a foundation for future investigations into data maintenance in humanitarian mapping. * The results of this work also show that the data produced during the selected humanitarian campaigns has been poorly maintained over time ] --- class: inverse, center, middle # In this example I would have liked to see some more actionable recommedations as opposed to.. > Future work should also more comprehensively investigate appropriate baseline levels of maintenance activity, for example by following the approach detailed here to quantify maintenance in areas of known high data quality --- # Set up your dissertation document ## Word -- * Use a reference manager - Zotero -- * Install the Word plugin -- * When you download the paper into Zotero make sure all the details are correct, it will save you time later when populating the reference list. -- * Back up your files, Word will crash and you might lose it all --- # Word 2.0 * Set heading level styles <img src="img/heading_styles.PNG" width="30%" style="display: block; margin: auto;" /> * Use numbered headings <img src="img/headings.PNG" width="300pt" style="display: block; margin: auto;" /> --- # Captions * Insert captions for figures and tables <img src="img/caption.PNG" width="200pt" style="display: block; margin: auto;" /> * Automatically cross reference them in the text<sup>1</sup> <img src="img/cross-reference.png" width="200pt" style="display: block; margin: auto;" /> .footnote[ [1] this includes headings] --- # Table of contents * Auto insert table of contents and table of figures <img src="img/table_of_contents.PNG" width="600pt" style="display: block; margin: auto;" /> *AND table of tables <img src="img/table_of_tables.PNG" width="300pt" style="display: block; margin: auto;" /> --- # Advanced headers and footers * Insert current chapter title into the page header <img src="img/header_chapter_name.PNG" width="200pt" style="display: block; margin: auto;" /> * Insert a footer - unlink from previous section to change style (e.g. roman numerals for table of contents then numbers for the rest of the documents) <img src="img/page_number_format.PNG" width="200pt" style="display: block; margin: auto;" /> --- # Page break * Useful to have different formatting on different sections - e.g. title page, abstract and then contents <img src="img/page_break.PNG" width="300pt" style="display: block; margin: auto;" /> --- class: inverse, center, middle # If the cross reference numbers aren't updating, control + P [print] then cancel and they will --- class: inverse, center, middle # When you finish your thesis use **Save as Adobe PDF** - it means the PDF document has bookmarks that can be clicked and isn't static --- # Bookdown * Full instructions: https://andrewmaclachlan.github.io/CASA-MSc-thesis/bookdown-basics.html Pros: * Makes a website of your thesis * One set of markdown files for multiple formats * Auto updates figures in the thesis as long as the file name is the same * Set up the style then never worry about it again -- Cons: * Longer time to learn * Can be tempting to try and change formatting --- class: inverse, center, middle # Do not do you analysis and thesis in the same R project. It's a **bad** idea --- class: inverse, center, middle # Copy the template # Fork to a new repo # New project from version control --- # Packages You will need: ```r library(bookdown) library(kabble) library(knitr) tinytex::install_tinytex() ``` --- # A Bookdown structure ```r directory/ ├── .Rproj.user ├── book.Rproj ├── 00-preamble.Rmd ├── 01-intro.Rmd ├── 02-literature.Rmd ├── 03-method.Rmd ├── 04-results.Rmd ├── 05-discussion.Rmd ├── 06-conclusion.Rmd ├── 07-references.Rmd ├── 08-appendix.Rmd ├── README.md ├── _bookdown.yml ├── _output.yml ├── book.bib ├── index.Rmd # headers for the book ├── preamble.tex # style for LaTex └── style.css # style for website ``` .footnote[ source: https://arm.rbind.io/slides/bookdown.html#12] --- class: inverse, center, middle  --- # Important files `index.Rmd` ```r title: Remotely sensing cities author: - | | Andrew MacLachlan | | CASA0010, MSc Smart Cities Dissertation | ...... date: "`r Sys.Date()`" site: bookdown::bookdown_site output: bookdown::gitbook documentclass: book classoption: oneside #openany or #twosides #if two then need to change headers and check margins. geometry: "left=4cm, right=3cm, top=2.5cm, bottom=2.5cm" fontsize: 12pt linestretch: 1.5 bibliography: [book.bib, packages.bib, test.bib] biblio-style: apa link-citations: yes github-repo: andrewmaclachlan/CASA-MSc-thesis description: "This dissertation is submitted in part requirement for the MSc (Or MRes) in the Centre for Advanced Spatial Analysis, Bartlett Faculty of the Built Environment, UCL " always_allow_html: yes ``` --- # Important files `_bookdown.yml` ```r output_dir: docs book_filename: "CASA-Thesis" rmd_files: - index.Rmd - 00-preamble.Rmd - 01-intro.Rmd - 02-literature.Rmd - 03-method.Rmd - 04-results.Rmd - 05-discussion.Rmd - 06-conclusion.Rmd - 07-references.Rmd - 08-appendix.Rmd language: ui: chapter_name: "Chapter " delete_merged_file: true ``` --- # Important files `preamble.tex` ```r \usepackage[none]{hyphenat} \pagestyle{plain} \raggedbottom \usepackage[nottoc,notlot,notlof]{tocbibind} \usepackage{pdfpages} \usepackage[width=\textwidth]{caption} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \setlength{\headheight}{15pt}% \fancyhead[RO,RE]{\nouppercase{\leftmark}} \fancyfoot[CO, CE] {\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} ``` .footnote[ \* I don't really know LaTex] --- # Important files `_output.yml` ```r bookdown::gitbook: css: style.css config: toc: collapse: section scroll_highlight: yes before: | <li class="toc-logo"><a href="https://www.ucl.ac.uk/bartlett/casa/"><img src="general_images/casa_logo.jpg"></a></li> after: | <li><a href="" target="blank"></a></li> edit: https://github.com/andrewmaclachlan/CASA-MSc-thesis/edit/main/%s download: ["pdf", "rmd"] sharing: github: yes facebook: no twitter: no all: no bookdown::pdf_book: toc: false includes: in_header: preamble.tex latex_engine: xelatex citation_package: biblatex keep_tex: yes #bookdown::epub_book: default #word_document: default ``` --- # The difficult file `index.Rmd` / `00-preamble.Rmd` * LaTex specific calls - we want roman numerals in the preamble ```r \pagenumbering{roman} ``` * If the output is LaTex we don't want the abstract numbered (and in the table of contents) BUT if it is HTML then we want it to appear in the table of contents (left side bar) ```r `r if (knitr:::is_html_output()) ' # Abstract {-} '` `r if (knitr:::is_latex_output()) ' # Abstract {.unlisted .unnumbered} '` ``` --- # The difficult file Setting the depth of the table of contents and calling table of figures and list of tables - this again is set with LaTex `=latex` ```r % Trigger ToC creation in LaTeX \setcounter{tocdepth}{3} \tableofcontents \listoffigures \listoftables ``` --- # Tables * For the example ones, i've made an excel document that is then read into R and formatted with the `kabble` package. * A massive benefit of using bookdown is now you can edit your RMarkdown documents with the visual editor * This also includes the ability to insert your own manual tables *But could you export a `.csv` from your analysis that is then read straight into R? --- # Cross referencing Now the difficult files are out of the way. * Each chapter is stored in its own `.Rmd`. * You should recall the heading types `#` and `##` * So we can have: `# Introduction {#intro}` * To reference the title `[intro]` or `[Introduction]` * To reference the section number `\@ref(intro)` -- * A figure caption is set in the code chunk ...`nice-fig, fig.cap='Here is a nice figure!'` * Cross reference the number use the chunk name...` Figure \@ref(fig:nice-fig)` * A table `\@ref(tab:nice-tab)` --- # Equations Need to learn a bit of LaTex ```r \begin{equation} p= h\frac{c}{\varrho} (\#eq:test) \end{equation} ``` p= h\frac{c}{\varrho} in $ `$$p= h\frac{c}{\varrho}$$` To reference this it's `\@ref(eq:test)` --- # Hosting * Don't mess around with the file structure * No you can't have a folder of `.Rmds` for chapters 1. Go to the `_bookdown.yml` file and make sue that that you have this line of code: `output_dir: docs` (it should be there) 1. In the same file make sure your `book_filename` doesn't have any spaces use `-` or `_` e.g. `CASA-Thesis` 1. Go to the `_output.yml` file and change the `edit` argument to `YOURREPO/edit/main/%s`, here it's `https://github.com/andrewmaclachlan/CASA-MSc-thesis/edit/main/%s` 1. Build your book locally, close the preview window 1. Save, stage changes, commit and then push to GitHub 1. On your GitHub repository > settings > GitHub pages > select the source as main and the folder as docs 1. Make sure you build your `.pdf` and then your `gitbook` for the latest `.pdf` to be a download option on the website. --- # Final tips * If you are trying to make a complicated table or format a page a certain way....don't. It's much easier to accept the defaults and work around them to include the required information * Set your document up **FIRST**, in word, LaTex or Bookdown. * In two months you will think you don't have time to do it and then get frustrated when it won't work * Ask questions on slack about using Bookdown * In the handbook there is a link to a LaTex template