::p_load(maptools, sf, raster, spatstat, tmap) pacman
Handon_Ex04
1st Order Spatial Point Patterns Analysis Methods
1. Overview
Using appropriate functions of spatstat, this hands-on exercise aims to discover the spatial point processes of childecare centres in Singapore.
Meanwhile, to answer these questions:
- Are the childcare centres in Singapore randomly distributed throughout the country?
- If the answer is not, then the next logical question is where are the locations with higher concentration of childcare centres?
2. The Data
To answer the question, here are the dataset to use:
CHILDCARE, a point feature data providing both location and attribute information of childcare centres. It was downloaded from Data.gov.sg and is in geojson format.
MP14_SUBZONE_WEB_PL, a polygon feature data providing information of URA 2014 Master Plan Planning Subzone boundary data. It is in ESRI shapefile format. This data set was also downloaded from Data.gov.sg.
CostalOutline, a polygon feature data showing the national boundary of Singapore. It is provided by SLA and is in ESRI shapefile format.
3. Loading the R packages
4. Spatial Data Wrangling
4.1 Read the data in
<- st_read("data/child-care-services-geojson.geojson") %>%
childcare_sf st_transform(crs = 3414)
Reading layer `child-care-services-geojson' from data source
`C:\Quanfang777\IS415-GAA\WeeklyExercise\week4\Hands-on_Ex04\data\child-care-services-geojson.geojson'
using driver `GeoJSON'
Simple feature collection with 1545 features and 2 fields
Geometry type: POINT
Dimension: XYZ
Bounding box: xmin: 103.6824 ymin: 1.248403 xmax: 103.9897 ymax: 1.462134
z_range: zmin: 0 zmax: 0
Geodetic CRS: WGS 84
<- st_read(dsn = "data", layer="CostalOutline") sg_sf
Reading layer `CostalOutline' from data source
`C:\Quanfang777\IS415-GAA\WeeklyExercise\week4\Hands-on_Ex04\data'
using driver `ESRI Shapefile'
Simple feature collection with 60 features and 4 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 2663.926 ymin: 16357.98 xmax: 56047.79 ymax: 50244.03
Projected CRS: SVY21
<- st_read(dsn = "data",
mpsz_sf layer = "MP14_SUBZONE_WEB_PL")
Reading layer `MP14_SUBZONE_WEB_PL' from data source
`C:\Quanfang777\IS415-GAA\WeeklyExercise\week4\Hands-on_Ex04\data'
using driver `ESRI Shapefile'
Simple feature collection with 323 features and 15 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 2667.538 ymin: 15748.72 xmax: 56396.44 ymax: 50256.33
Projected CRS: SVY21
4.2 Check the CRS information
<- st_set_crs(mpsz_sf, 3414) mpsz3414
Warning: st_crs<- : replacing crs does not reproject data; use st_transform for
that
<- st_set_crs(sg_sf, 3414)} {sg_sf3414
Warning: st_crs<- : replacing crs does not reproject data; use st_transform for
that
st_crs(childcare_sf)
Coordinate Reference System:
User input: EPSG:3414
wkt:
PROJCRS["SVY21 / Singapore TM",
BASEGEOGCRS["SVY21",
DATUM["SVY21",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4757]],
CONVERSION["Singapore Transverse Mercator",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",1.36666666666667,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",103.833333333333,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",28001.642,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",38744.572,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["northing (N)",north,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["easting (E)",east,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Cadastre, engineering survey, topographic mapping."],
AREA["Singapore - onshore and offshore."],
BBOX[1.13,103.59,1.47,104.07]],
ID["EPSG",3414]]
st_crs(mpsz_sf)
Coordinate Reference System:
User input: SVY21
wkt:
PROJCRS["SVY21",
BASEGEOGCRS["SVY21[WGS84]",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ID["EPSG",6326]],
PRIMEM["Greenwich",0,
ANGLEUNIT["Degree",0.0174532925199433]]],
CONVERSION["unnamed",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",1.36666666666667,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",103.833333333333,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",28001.642,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",38744.572,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
st_crs(sg_sf)
Coordinate Reference System:
User input: SVY21
wkt:
PROJCRS["SVY21",
BASEGEOGCRS["SVY21[WGS84]",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ID["EPSG",6326]],
PRIMEM["Greenwich",0,
ANGLEUNIT["Degree",0.0174532925199433]]],
CONVERSION["unnamed",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",1.36666666666667,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",103.833333333333,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",28001.642,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",38744.572,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
Although mpsz data frame is projected in svy21 but when we read until the end of the print, it indicates that the EPSG is 9001. This is a wrong EPSG code because the correct EPSG code for svy21 should be 3414.
4.3 Assign the correct EPSG code
# the crs is correctly assigned
st_crs(mpsz3414)
Coordinate Reference System:
User input: EPSG:3414
wkt:
PROJCRS["SVY21 / Singapore TM",
BASEGEOGCRS["SVY21",
DATUM["SVY21",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4757]],
CONVERSION["Singapore Transverse Mercator",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",1.36666666666667,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",103.833333333333,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",28001.642,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",38744.572,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["northing (N)",north,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["easting (E)",east,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Cadastre, engineering survey, topographic mapping."],
AREA["Singapore - onshore and offshore."],
BBOX[1.13,103.59,1.47,104.07]],
ID["EPSG",3414]]
st_crs(sg_sf3414)
Coordinate Reference System:
User input: EPSG:3414
wkt:
PROJCRS["SVY21 / Singapore TM",
BASEGEOGCRS["SVY21",
DATUM["SVY21",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4757]],
CONVERSION["Singapore Transverse Mercator",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",1.36666666666667,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",103.833333333333,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",28001.642,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",38744.572,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["northing (N)",north,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["easting (E)",east,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Cadastre, engineering survey, topographic mapping."],
AREA["Singapore - onshore and offshore."],
BBOX[1.13,103.59,1.47,104.07]],
ID["EPSG",3414]]
tmap_mode("plot")
tmap mode set to plotting
tm_shape(mpsz3414)+ tm_polygons() + tm_shape(childcare_sf) + tm_dots()
tmap_mode('view')
tmap mode set to interactive viewing
tm_shape(childcare_sf)+
tm_dots()
5. Geospatial Data wrangling
5.1 Converting sf data frames to sp’s Spatial class
<- as_Spatial(childcare_sf)
childcare <- as_Spatial(mpsz_sf)
mpsz <- as_Spatial(sg_sf) sg
5.2 Converting the Spatial* class into generic sp format
<- as(childcare, "SpatialPoints")
childcare_sp <- as(sg, "SpatialPolygons") sg_sp
5.3 Converting the generic sp format into spatstat’s ppp format
<- as(childcare_sp, "ppp")
childcare_ppp childcare_ppp
Planar point pattern: 1545 points
window: rectangle = [11203.01, 45404.24] x [25667.6, 49300.88] units
plot(childcare_ppp)
5.4 Handling duplicated points
any(duplicated(childcare_ppp))
[1] TRUE
<- rjitter(childcare_ppp,
childcare_ppp_jit retry=TRUE,
nsim=1,
drop=TRUE)
sum(multiplicity(childcare_ppp) > 1)
[1] 128
tmap_mode('view')
tmap mode set to interactive viewing
tm_shape(childcare) +
tm_dots(alpha=0.4,
size=0.05)
5.5 Creating owin object
When analysing spatial point patterns, it is a good practice to confine the analysis with a geographical area like Singapore boundary, so we can covert sg SpatialPolygon object into owin object of spatstat.
<- as(sg_sp, "owin") sg_owin
plot(sg_owin)
5.6 Combining point events object and owin object
= childcare_ppp[sg_owin] childcareSG_ppp
6.First-order Spatial Point Patterns Analysis
6.1 Kernel Density Estimation
6.1.1 Computing kernel density estimation using automatic bandwidth selection method
<- density(childcareSG_ppp,
kde_childcareSG_bw sigma=bw.diggle,
edge=TRUE,
kernel="gaussian")
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
plot(kde_childcareSG_bw)
<- bw.diggle(childcareSG_ppp)
bw bw
sigma
298.4095
<- rescale(childcareSG_ppp, 1000, "km") childcareSG_ppp.km
<- density(childcareSG_ppp.km, sigma=bw.diggle, edge=TRUE, kernel="gaussian") kde_childcareSG.bw
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
plot(kde_childcareSG.bw)
6.2 Fixed and Adaptive KDE
<- density(childcareSG_ppp.km, sigma=0.6, edge=TRUE, kernel="gaussian") kde_childcareSG_600
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
plot(kde_childcareSG_600)
<- adaptive.density(childcareSG_ppp.km, method="kernel") kde_childcareSG_adaptive
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 215 points (total score not 0
or 1)
plot(kde_childcareSG_adaptive)
par(mfrow=c(1,2))
plot(kde_childcareSG.bw, main = "Fixed bandwidth")
plot(kde_childcareSG_adaptive, main = "Adaptive bandwidth")
6.3 Converting KDE output into grid object
<- as.SpatialGridDataFrame.im(kde_childcareSG.bw)
gridded_kde_childcareSG_bw spplot(gridded_kde_childcareSG_bw)
6.4 Converting gridded output into raster
<- raster(gridded_kde_childcareSG_bw) kde_childcareSG_bw_raster
6.5 Assigning projection systems
projection(kde_childcareSG_bw_raster) <- CRS("+init=EPSG:3414")
kde_childcareSG_bw_raster
class : RasterLayer
dimensions : 128, 128, 16384 (nrow, ncol, ncell)
resolution : 0.4170614, 0.2647348 (x, y)
extent : 2.663926, 56.04779, 16.35798, 50.24403 (xmin, xmax, ymin, ymax)
crs : +proj=tmerc +lat_0=1.36666666666667 +lon_0=103.833333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs
source : memory
names : v
values : -8.476185e-15, 28.51831 (min, max)
6.6 Visualising the output in tmap
tm_shape(kde_childcareSG_bw_raster) +
tm_raster("v") +
tm_layout(legend.position = c("right", "bottom"), frame = FALSE)
legend.postion is used for plot mode. Use view.legend.position in tm_view to set the legend position in view mode.
Variable(s) "v" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
6.7 Comparing Spatial Point Patterns using KDE
= mpsz[mpsz@data$PLN_AREA_N == "PUNGGOL",]
pg = mpsz[mpsz@data$PLN_AREA_N == "TAMPINES",]
tm = mpsz[mpsz@data$PLN_AREA_N == "CHOA CHU KANG",]
ck = mpsz[mpsz@data$PLN_AREA_N == "JURONG WEST",] jw
par(mfrow=c(2,2))
plot(pg, main = "Ponggol")
plot(tm, main = "Tampines")
plot(ck, main = "Choa Chu Kang")
plot(jw, main = "Jurong West")
= as(pg, "SpatialPolygons")
pg_sp = as(tm, "SpatialPolygons")
tm_sp = as(ck, "SpatialPolygons")
ck_sp = as(jw, "SpatialPolygons") jw_sp
= as(pg_sp, "owin")
pg_owin = as(tm_sp, "owin")
tm_owin = as(ck_sp, "owin")
ck_owin = as(jw_sp, "owin") jw_owin
= childcare_ppp_jit[pg_owin]
childcare_pg_ppp = childcare_ppp_jit[tm_owin]
childcare_tm_ppp = childcare_ppp_jit[ck_owin]
childcare_ck_ppp = childcare_ppp_jit[jw_owin] childcare_jw_ppp
= rescale(childcare_pg_ppp, 1000, "km")
childcare_pg_ppp.km = rescale(childcare_tm_ppp, 1000, "km")
childcare_tm_ppp.km = rescale(childcare_ck_ppp, 1000, "km")
childcare_ck_ppp.km = rescale(childcare_jw_ppp, 1000, "km") childcare_jw_ppp.km
par(mfrow=c(2,2))
plot(childcare_pg_ppp.km, main="Punggol")
plot(childcare_tm_ppp.km, main="Tampines")
plot(childcare_ck_ppp.km, main="Choa Chu Kang")
plot(childcare_jw_ppp.km, main="Jurong West")
par(mfrow=c(2,2))
plot(density(childcare_pg_ppp.km,
sigma=bw.diggle,
edge=TRUE,
kernel="gaussian"),
main="Punggol")
plot(density(childcare_tm_ppp.km,
sigma=bw.diggle,
edge=TRUE,
kernel="gaussian"),
main="Tempines")
plot(density(childcare_ck_ppp.km,
sigma=bw.diggle,
edge=TRUE,
kernel="gaussian"),
main="Choa Chu Kang")
plot(density(childcare_jw_ppp.km,
sigma=bw.diggle,
edge=TRUE,
kernel="gaussian"),
main="JUrong West")
Nearest Neighbour Analysis
Testing spatial point patterns using Clark and Evans Tes
clarkevans.test(childcareSG_ppp,
correction="none",
clipregion="sg_owin",
alternative=c("clustered"),
nsim=99)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 29 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 29 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 11 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 33 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 10 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 7 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 11 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 27 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 30 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 25 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 10 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 16 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 15 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 24 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 28 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 26 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 19 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 23 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 18 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 21 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 14 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 17 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 22 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 13 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 20 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Warning: point-in-polygon test had difficulty with 12 points (total score not 0
or 1)
Clark-Evans test
No edge correction
Monte Carlo test based on 99 simulations of CSR with fixed n
data: childcareSG_ppp
R = 0.54756, p-value = 0.01
alternative hypothesis: clustered (R < 1)
Clark and Evans Test: Choa Chu Kang planning area
clarkevans.test(childcare_ck_ppp,
correction="none",
clipregion=NULL,
alternative=c("two.sided"),
nsim=999)
Clark-Evans test
No edge correction
Monte Carlo test based on 999 simulations of CSR with fixed n
data: childcare_ck_ppp
R = 0.89407, p-value = 0.026
alternative hypothesis: two-sided
Clark and Evans Test: Tampines planning area
clarkevans.test(childcare_tm_ppp,
correction="none",
clipregion=NULL,
alternative=c("two.sided"),
nsim=999)
Clark-Evans test
No edge correction
Monte Carlo test based on 999 simulations of CSR with fixed n
data: childcare_tm_ppp
R = 0.78883, p-value = 0.002
alternative hypothesis: two-sided