Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
gregridgeway committed Feb 12, 2019
1 parent 90a6c05 commit 29faf55
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 07_Crime_Hotspot_Map.Rmd
Expand Up @@ -169,7 +169,7 @@ chicago.map +
high="hotpink")
```

You can also do a map that shows the high crime areas in a way that is akin to elevation on a topographic map. The more concentrated the concentric areas, the higher the crime (or, in the case of a topographic map, the higher the terrain). Note that a plot using `stat_density2d()` requires a lot of memory. That's why it's a good idea to use a sample of cases.
You can also create a map that shows the high crime areas in a way that is akin to elevation on a topographic map. The more concentrated the concentric areas, the higher the crime (or, in the case of a topographic map, the higher the terrain). Note that a plot using `stat_density2d()` requires a lot of memory. That's why it's a good idea to use a sample of cases.

```{r comment="", results='hold'}
i <- sample(1:nrow(dataAllcrime),100000)
Expand Down Expand Up @@ -215,7 +215,7 @@ chicago.map +
guides(fill = guide_colorbar(barwidth = 1.5, barheight = 10))
```

Let's do hotspot maps with just motor vehicle theft, and let's make a map for each year between 2005 and 2014. Note the line with the SQL function `SUBSTR()`. The `SUBSTR()` command helps us grab a section of a string. Here's an example. Take a look at the `Date` column in our initial dataset.
Let's create hotspot maps with just motor vehicle theft, and let's make a map for each year between 2005 and 2014. Note the line with the SQL function `SUBSTR()`. The `SUBSTR()` command helps us grab a section of a string. Here's an example. Take a look at the `Date` column in our initial dataset.
```{r comment="", results='hold'}
res <- dbSendQuery(con, "SELECT Date
FROM crime
Expand Down
76 changes: 70 additions & 6 deletions 07_Crime_Hotspot_Map.html

Large diffs are not rendered by default.

Binary file modified 07_Crime_Hotspot_Map.pdf
Binary file not shown.

0 comments on commit 29faf55

Please sign in to comment.