Learn R Programming

geostatsp (version 2.0.6)

murder: Murder locations

Description

Locations of murders in Toronto 1990-2014

Usage

data("murder")

Arguments

Format

murder is a SpatVector object of murder locations. torontoPdens, torontoIncome, and torontoNight are rasters containing population density (per hectare), median household income, and ambient light respectively. torontoBorder is a SpatVector of the boundary of the city of Toronto.

Examples

Run this code
data("murder")
murder= unwrap(murder)
torontoBorder = unwrap(torontoBorder)

plot(torontoBorder)
points(murder, col="#0000FF40", cex=0.5)

data("torontoPop")
torontoNight = unwrap(torontoNight)
torontoIncome = unwrap(torontoIncome)
torontoPdens = unwrap(torontoPdens)

# light
plot(torontoNight, main="Toronto ambient light")
plot(torontoBorder, add=TRUE)
points(murder, col="#0000FF40", cex=0.5)


# income
plot(torontoIncome, main="Toronto Income")
points(murder, col="#0000FF40", cex=0.5)
plot(torontoBorder, add=TRUE)

# population density
plot(torontoPdens, main="Toronto pop dens")
points(murder, col="#0000FF40", cex=0.5)
plot(torontoBorder, add=TRUE)

Run the code above in your browser using DataLab