Create a standard theme map from an sf object
LA_map.Rd
Create a standard theme map from an sf object
Usage
LA_map(
.data,
variable,
LA_col,
map_colours = c("#FFFFFF", "#012169"),
year = 2022,
countries = "E",
save = FALSE,
filepath = NULL
)
Arguments
- .data
An sf object which has data broken down by local authority. This function only works for data in local authority breakdown only.
- variable
The column in the .data which has the numeric value to be mapped
- LA_col
The column which contains the Local Authority code
- map_colours
The colour which you want to represent the low and high values, must be in vector form
- year
The year which the LA codes you are using relate to
- countries
The countries which you wish to appear on the map. These are E, E+W, GB and UK for England, England+Wales, Great Britain and United Kingdom respectively
- save
A TRUE/FALSE statement if you want the file to be exported as a png file. If TRUE, the filepath must be defined
- filepath
If save is TRUE, filepath is the save location of the png output must be in the form of quotations
Examples
df <- dluhctheme::Net_Additions_LA
#> Error: 'Net_Additions_LA' is not an exported object from 'namespace:dluhctheme'
LA_map(df,variable = Net_Additions_per_1000,LA_col = LA_Code,year = 2021,countries = "E",save = TRUE, filepath = "Net_Additions_map.png")
#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
#> ✔ ggplot2 3.4.0 ✔ purrr 1.0.1
#> ✔ tibble 3.1.8 ✔ dplyr 1.0.10
#> ✔ tidyr 1.2.1 ✔ stringr 1.5.0
#> ✔ readr 2.1.3 ✔ forcats 0.5.2
#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag() masks stats::lag()
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
#> Error in UseMethod("mutate"): no applicable method for 'mutate' applied to an object of class "function"