Violent crime in Japanese prefectures
Create a short Quarto report about variation in recorded violent crime at prefecture level in Japan in 2012.
Before you start
Complete Chapters 1–11 of Learn Crime Mapping with R.
You will practise downloading and reading data, tidying a dataset, joining statistics to boundaries, calculating crime rates, creating interactive choropleth maps and combining maps with explanatory text in a Quarto report.
You can use this Quarto report template as a starting point for writing your report.
What your report must show
The report should show a map of the incidence rates of each type of violence at prefecture level, along with supporting text describing which prefectures had the highest and lowest rates.
Use these two datasets:
- Crime counts and population, in RDS format:
https://mpjashby.github.io/crimemappingdata/japan_violence_counts.rds - Prefecture boundaries, in geopackage format:
https://mpjashby.github.io/crimemappingdata/japan_prefectures.gpkg
Read the RDS file with read_rds() from the readr package (part of tidyverse).
See the documentation for the crime counts and population and prefecture boundaries. The crime counts dataset is not in a tidy format, so you will need to tidy it before going any further.
Credit the Statistics Bureau of Japan for the statistics (CC BY) and OCHA for the boundaries (CC BY-IGO).
Write all your code and report text in one .qmd file that renders to HTML. Make sure no R code is included in the final report output, since this would be likely to be very confusing to a non-technical audience.
Checklist for this exercise
- The report produces an HTML document.
- The report has a suitable title, author and date.
- The report does not include any R code or raw R output. The only output included in the report should be the maps and text that you write.
- The report should include an incidence rate map for each type of violence.
- The maps should be interactive.
- The maps show the rates clearly.
- The maps should include suitable text to explain how to interpret the crime rates.
- The data used is appropriately cited.
The code
- The
.qmdfile contains the report text and all analytical code. - All necessary packages are loaded at the start.
- Original files are downloaded to
data/raw, read using workspace-relative paths and left unchanged. - Population in thousands is converted correctly, and each prefecture has the correct crime counts and boundary.
- Column and object names use snake case, and comments explain each analytical step.
Check your answer
After attempting the task, read the specimen answer and walk-through. It shows one possible solution, including some additional analysis beyond the requirements.