Skip to content

Commit

Permalink
Typos and add sentence on help for tm_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbearman committed May 31, 2023
1 parent 9c36274 commit afa6898
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions workbook.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ output:
pdf_document: default
html_document:
df_print: paged
date: "Wed 3rd May 2023"
date: "Wed 7th and Thu 8th June 2023"
---

```{r setup, echo=FALSE}
Expand Down Expand Up @@ -242,7 +242,7 @@ Working with R often requires several lines of code to get an output. Rather tha

Create a new script (**File > New File > R Script**) and enter the code in there. Then you can select the lines you want to run by highlighting them, and then pressing `Ctrl+Enter`, or using the **Run** button.

Now we are going to use the same principle as we used before to create a map of some data from the 2021 Census. We need to download the data, and although there are other sources of these data, in this example we will use the https://www.nomisweb.co.uk/ website.
Now we are going to use the same principle as we used before to create a map of some data from the 2011 Census. We need to download the data, and although there are other sources of these data, in this example we will use the https://www.nomisweb.co.uk/ website.

- Navigate to **https://www.nomisweb.co.uk/**.
- Under **Census Statistics** (scroll down) click **2021 Data catalogue**.
Expand Down Expand Up @@ -293,7 +293,7 @@ newcolnames <- c("Total","Age00to04","Age05to09","Age10to14","Age15to19",
"Age60to64","Age65to69","Age70to74","Age75to79",
"Age80to84","Age85andOver")
#apply these to pop2021 data frame
#apply these to pop2011 data frame
colnames(pop2021)[4:22] <- newcolnames
```

Expand Down Expand Up @@ -374,8 +374,6 @@ tm_shape(LSOA) +

This allows us to change the title, colours and legend title size. Try substituting in `Blues` and adjusting the title.

By the time you get to this section, we should have completed the ‘Classification’ discussion and talked about class boundaries and colours. If we haven’t yet, please let me know that you have reached this point.

### Colours and Categories

We can choose lots of different colours from ColorBrewer, and different classification methods as well. To show all of the different colour palettes we could use, run this code:
Expand Down Expand Up @@ -440,7 +438,7 @@ tm_shape(LSOA) +

### Layout Options and Margins (optional exercise)

`tmap` has a huge number of options to customise the layout - have a look at https://rdrr.io/cran/tmap/man/tm_layout.html as a starting point.
`tmap` has a huge number of options to customise the layout - have a look at https://rdrr.io/cran/tmap/man/tm_layout.html as a starting point. You can also try the help, e.g. run `?tm_layout` which will show the help file for `tm_layout`, which is quite good.

You may often have to adjust the margins to make your map look good. Adjusting the `inner.margins` is a good starting point. It is a vector (list) of four values specifying the bottom, left, top, and right margins, in that order. For example:

Expand Down

0 comments on commit afa6898

Please sign in to comment.