mpjashby / crimemapping Goto Github PK
View Code? Open in Web Editor NEWTutorials for crime mapping in R
Home Page: http://books.lesscrime.info/learncrimemapping/
License: Creative Commons Attribution 4.0 International
Tutorials for crime mapping in R
Home Page: http://books.lesscrime.info/learncrimemapping/
License: Creative Commons Attribution 4.0 International
The box should be approximately here:
harmonise_image_sizes()
harmonise_image_sizes()
harmonise_image_sizes()
Use Allison Horst monsters and some CSS to denote these boxes.
Since interactive maps might be particularly useful for exploring a geoprofile surface. Possibly use the mapview
package or possibly leaflet
.
At:
crimemapping/inst/tutorials/02_your_first_crime_map/02.Rmd
Lines 325 to 337 in db1960b
the tutorial tells students this will be explained later, but it doesn't appear to be actually explained anywhere. A possible answer is in this answer to a question on Moodle.
Possibly resize full-width cartoons to 800px width at 150dpi and hex stickers to 150px at 150dpi. Remember to add max-width
to the corresponding CSS so that images are not scaled too large.
It would be useful for students to understand the difference between syntax errors (meaning R cannot interpret what the code means) and runtime/logical errors (meaning R know what the code says but what you are trying to do causes some sort of error).
Use this blog post by Allison Horst as a starting point.
Geocomputation in R recommends at section 7.2:
we recommend the more explicit AUTHORITY:CODE representation to prevent ambiguity and to provide context.
Since this affects almost all the tutorials, it will need to be implemented in the next complete update of the tutorials for January 2023.
harmonise_image_sizes()
----
feature of MarkdownThe Geocoding page of the Messy Data tutorial says that the Nominatim API allows 1 call per second that that equates to 3,600 per day, but 1 per second equates to 1 * 60 * 60 * 24 = 86,400
calls per day, so this needs to be checked.
Mention that an EPSG code is a way to reference an entry in a database of ways to translate numbers to points on the earth. Give examples like 'EPSG 27700 tells R that co-ordinates reference points on the earth in terms of how many metres they are north and east of a point in the Atlantic Ocean' vs [something else].
The tutorial 'Mapping area data' currently uses the tmap
package for static choropleth maps. These would be better done with the cartography
package because it allows inclusion of base maps on static choropleth maps. Keep using tmap
as a wrapper around leaflet
for dynamic maps.
Probably best done in the context of geocode()
from ggmap
and tidygeocoder
in the messy-data tutorial.
It's not possible to do justice to geographic profiling justice in the time available and this is a case where a little knowledge could well be dangerous, so remove this content.
Include an example of loading a file in a different directory, e.g. ~/Downloads
.
In particular, show the iterative process of writing a bit of code, checking the output, fixing any errors and then writing the next bit.
Add to tutorial 5 (second crime map) a video that distinguishes code that you write in the process of developing a script (e.g. using head()
to view part of a dataset) and code that is required within the script itself.
This should demonstrate that proportional symbol maps might be better than choropleth maps when there are extreme differences in the size of different areas, as illustrated by Andy Wheeler.
harmonise_image_sizes()
This might be useful in a list of top 10 hotspot mapping mistakes, or something like that.
To make it clear to students if they're accidentally using an out-dated version of a tutorial.
Using the stplanr
library
harmonise_image_sizes()
Some Windows users need to use mode = "wb"
when downloading a binary file using download.file()
, e.g. a zip archive, Excel file or gzipped CSV.
Tables are generally better when readers need to know exact values for variables, or when you need to present several quantities for each unit of analysis. Charts are better at showing patterns or differences. A chart accompanied by an appendix table can be the best of both worlds.
Possibly:
Students are still not doing this, which means:
At the moment, when asked to choose crime types for police to focus on, many (most?) students simply choose the most frequent. Add a section to explain on what basis you can choose to prioritise different types of crime, including joining harm weights to crime counts and then producing a harm-weighted bar chart.
For example, base::attach()
.
In each case, explain why students shouldn't use it.
This should probably go in the tutorial on handling errors, since the reason the functions should not be used will typically because they make code (or coders) more prone to errors.
Since some of the data files are also used by the https://github.com/mpjashby/learn-pop/ package of tutorials, it would be better if the data files could be housed in a separate repo. This would also make it easier for other people to use the data, so it would be useful to provide some documentation for each dataset at the same time.
Use the cartography
package instead of Color Brewer for colour ramps because cartography
allows more than nine colours in a ramp.
This needs to be carefully chosen to minimise the risk that anyone taking the course might be distressed because they know someone involved (this has happened to me before). It needs a travelling offender. Only the necessary details of the crimes should be included and no details of the offender.
Possibly using the canal murders around Frankfurt between 1976 and 1983. Use data from the Wikipedia page (the German and English pages are virtually identical, but both have exact dates and locations) plus this record of some newspaper research done (translated from DE to EN) to confirm some of the locations.
harmonise_image_sizes()
In some of their assessments, students have claimed 'strong relationships' or similar between variables based on a scatter plot, even when there is little or no actual relationship. Add a note to the section on scatter plots to warn students not to attempt to judge relationships visually.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.