Learn R Programming

TexMix (version 0.5.3)

foodStoresShp: Point layer of Stores selling Food in Dallas County, TX

Description

Location of food stores in Dallas County, TX, in the longitude and latitude format (see proj4string=CRS("+proj=longlat +ellps=WGS84"))..

Arguments

Format

Spatial polygon data-frame with 1623 verified store locations.

SALESVOL

Reported total annual sales volume of goods in $

PROPFOOD

Assumed proportion of food sales

FOODSALES

Calculated annual sales volume of food in $

STORETYPE

Factor distinguishing between stores selling nutritious food (grocery stores) and processed food (convenience stores)

Examples

Run this code
# NOT RUN {
library(spatstat)
library(rgdal)
library(sp)
proj4string(bndShp)                                     # Current system
projUTM <- CRS("+proj=utm +zone=14  +units=m")          # isotropic coordinate sytem
bndUTM <- spTransform(bndShp, projUTM)                  # Re-project boundary
storesUTM <- spTransform(foodStoresShp, projUTM)        # Re-project points
storesDf <- as.data.frame(storesUTM)                    # Extract data-frame
storesPts <- as.ppp(storesUTM)                          # Convert to .ppp
storesPts$marks <- NULL                                 # Clear marks
bndWin <- as.mask(as.owin(bndUTM), eps=200)             # pixel window with 200 m resolution
unitname(bndWin) <- list("meter","meters")              # set units
storesPts <- storesPts[bndWin]                          # assign window to pts
summary(storesPts)

## Evaluate weighted kernel density with bw=3000
allFoodIm <- density(storesPts, weights=storesDf$FOODSALES, sigma=3000)
plot(allFoodIm, main="All Stores Weighted Kernel Density\nbw = 3000 m")
plot(storesPts, cex=0.5, pch=16, col="green", add=TRUE)
box(); axis(1); axis(2)

# }

Run the code above in your browser using DataLab