Data Used

Aspatial

  1. listings.csv - Provided

Geospatial

  1. MP14_SUBZONE_WEB_PL

Install relevant R packages

packages = c('rgdal', 'maptools', 'raster','spatstat', 'tmap','sf','SpatialEpi', 'tidyverse','spData')
for (p in packages){
if(!require(p, character.only = T)){
install.packages(p)
}
library(p,character.only = T)
}

Import MP14_SUBZONE layer and named it as mpsz

mpsz <- readOGR(dsn = "data/geospatial", layer="MP14_SUBZONE_WEB_PL")
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\IS415 Geospatial Analytics and Applications\take-home2\Take_home_Exe02\data\geospatial", layer: "MP14_SUBZONE_WEB_PL"
## with 323 features
## It has 15 fields
mpsz
## class       : SpatialPolygonsDataFrame 
## features    : 323 
## extent      : 2667.538, 56396.44, 15748.72, 50256.33  (xmin, xmax, ymin, ymax)
## crs         : +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 
## variables   : 15
## names       : OBJECTID, SUBZONE_NO, SUBZONE_N, SUBZONE_C, CA_IND, PLN_AREA_N, PLN_AREA_C,       REGION_N, REGION_C,          INC_CRC, FMEL_UPD_D,     X_ADDR,     Y_ADDR,    SHAPE_Leng,    SHAPE_Area 
## min values  :        1,          1, ADMIRALTY,    AMSZ01,      N, ANG MO KIO,         AM, CENTRAL REGION,       CR, 00F5E30B5C9B7AD8, 2014/12/05,  5092.8949,  19579.069, 871.554887798, 39437.9352703 
## max values  :      323,         17,    YUNNAN,    YSSZ09,      Y,     YISHUN,         YS,    WEST REGION,       WR, FFCCF172717C2EAF, 2014/12/05, 50424.7923, 49552.7904, 68083.9364708,  69748298.792

Import listings data set and named it as airbnb.

airbnb <- read_csv("data/aspatial/listings.csv")

After looking through the details of the data set, the coords of the data set is in longitude and latitude format. One key point to take note is the CRS of the langitude and latitude. It should be in WGS84 (EPSG:4326).

Commonly used by organizations that provide GIS data for the entire globe or many countries. CRS used by Google Earth.

airbnb_sf <- st_as_sf(airbnb, coords = c("longitude","latitude"), crs = 4326)

By using function st_transform, we are able to convert the longitude and latitude to XY coords by defining the EPSG as 3414 (SV21).

airbnb_sf <-st_transform(airbnb_sf, CRS("+init=epsg:3414"))
airbnb_sf
## Simple feature collection with 7713 features and 14 fields
## geometry type:  POINT
## dimension:      XY
## bbox:           xmin: 7215.566 ymin: 25166.35 xmax: 43401.32 ymax: 48466.72
## epsg (SRID):    NA
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs
## # A tibble: 7,713 x 15
##        id name  host_id host_name neighbourhood_g~ neighbourhood room_type price
##     <dbl> <chr>   <dbl> <chr>     <chr>            <chr>         <chr>     <dbl>
##  1  49091 "COZ~  266763 Francesca North Region     Woodlands     Private ~    87
##  2  50646 "Ple~  227796 Sujatha   Central Region   Bukit Timah   Private ~    80
##  3  56334 "COZ~  266763 Francesca North Region     Woodlands     Private ~    72
##  4  71609 "Ens~  367042 Belinda   East Region      Tampines      Private ~   214
##  5  71896 "B&B~  367042 Belinda   East Region      Tampines      Private ~    99
##  6  71903 "Roo~  367042 Belinda   East Region      Tampines      Private ~   109
##  7  71907 "3rd~  367042 Belinda   East Region      Tampines      Private ~   217
##  8 117957 "Pri~  448620 Lynnity   North-East Regi~ Sengkang      Private ~    67
##  9 241503 "Lon~ 1017645 Bianca    East Region      Bedok         Private ~    52
## 10 241508 "Lon~ 1017645 Bianca    East Region      Bedok         Private ~    54
## # ... with 7,703 more rows, and 7 more variables: minimum_nights <dbl>,
## #   number_of_reviews <dbl>, last_review <date>, reviews_per_month <dbl>,
## #   calculated_host_listings_count <dbl>, availability_365 <dbl>,
## #   geometry <POINT [m]>

Removing those irrelevant column and only keep the room_type column.

airbnb_sf <- subset(airbnb_sf, select = -c(name, host_id,host_name,neighbourhood_group,price,minimum_nights,number_of_reviews,last_review,reviews_per_month, calculated_host_listings_count,availability_365,id,neighbourhood))

Filter room_type by Private room.

private <- airbnb_sf %>%
  filter(room_type == "Private room")

Filter room_type by Hotel room.

Hotel <- airbnb_sf %>%
  filter(room_type == "Hotel room")

Filter room_type by Shared room.

Shared <- airbnb_sf %>%
  filter(room_type == "Shared room") 

Filter room_type by Entire home/apt

Entire <- airbnb_sf %>%
  filter(room_type == "Entire home/apt")

Convert private to Spatialpoints format which only left the coords without any other information.

private_sp <- as(private, "Spatial")
private_sp <- as(private_sp, "SpatialPoints")

Convert hotel to Spatialpoints format which only left the coords without any other information.

Hotel_sp <- as(Hotel, "Spatial")
Hotel_sp <- as(Hotel_sp, "SpatialPoints")

Convert share to Spatialpoints format which only left the coords without any other information.

Shared_sp <- as(Shared, "Spatial")
Shared_sp <- as(Shared_sp, "SpatialPoints")

Convert entire to Spatialpoints format which only left the coords without any other information.

Entire_sp <- as(Entire, "Spatial")
Entire_sp <- as(Entire_sp, "SpatialPoints")

Converting the data set in to spatstat’s ppp object format.

private_ppp <- as(private_sp,"ppp")
private_ppp_jit <- rjitter(private_ppp, retry=TRUE, nsim=1, drop=TRUE)
entire_ppp <- as(Entire_sp,"ppp")
entire_ppp_jit <- rjitter(entire_ppp, retry=TRUE, nsim=1, drop=TRUE)
hotel_ppp <- as(Hotel_sp,"ppp")
hotel_ppp_jit <- rjitter(hotel_ppp, retry=TRUE, nsim=1, drop=TRUE)
shared_ppp <- as(Shared_sp,"ppp")
shared_ppp_jit <- rjitter(shared_ppp, retry=TRUE, nsim=1, drop=TRUE)

Extract the target planning areas

Aljunied <- mpsz[mpsz@data$SUBZONE_N == "ALJUNIED",]
Balestier <- mpsz[mpsz@data$SUBZONE_N == "BALESTIER",]

Converting the spatial point data frame into generic sp format

Aljunied_sp <- as(Aljunied, "SpatialPolygons")
Balestier_sp <- as(Balestier, "SpatialPolygons")

Creating owin object

Aljunied_owin <- as(Aljunied_sp, "owin")
Balestier_owin <- as(Balestier_sp, "owin")
private_Aljunied_ppp <- private_ppp_jit[Aljunied_owin]
shared_Aljunied_ppp <- shared_ppp_jit[Aljunied_owin]
hotel_Aljunied_ppp <- hotel_ppp_jit[Aljunied_owin]
entire_Aljunied_ppp <- entire_ppp_jit[Aljunied_owin]
private_Balestier_ppp <- private_ppp_jit[Balestier_owin]
shared_Balestier_ppp <- shared_ppp_jit[Balestier_owin]
hotel_Balestier_ppp <- hotel_ppp_jit[Balestier_owin]
entire_Balestier_ppp <- entire_ppp_jit[Balestier_owin]

8. Aljunied Kernel Density Maps

8.1.1 Aljunied kernel density maps for Private

Computing KDE

kde_private_Aljunied_bw <- density(private_Aljunied_ppp, sigma=bw.diggle, edge=TRUE, kernel="gaussian") 
plot(kde_private_Aljunied_bw)

WARNNING: The land area of Aljunied is very small approximately 3km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

private_Aljunied_ppp.100m <- rescale(private_Aljunied_ppp, 100, "m")
kde_private_Aljunied.bw <- density(private_Aljunied_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_private_Aljunied.bw)

gridded_kde_private_Aljunied_bw <- as.SpatialGridDataFrame.im(rescale(kde_private_Aljunied.bw, 1/100,"m"))
spplot(gridded_kde_private_Aljunied_bw)

kde_private_Aljunied_bw_raster <- raster(gridded_kde_private_Aljunied_bw)
kde_private_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : -6.010164e-16, 29.91738  (min, max)
projection(kde_private_Aljunied_bw_raster) <- CRS("+init=EPSG:3414")
kde_private_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : -6.010164e-16, 29.91738  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

8.1.2 Kernel density maps on openstreetmap of Singapore for Private

tm_shape(kde_private_Aljunied_bw_raster) +
  tm_raster("v", breaks = c(0,5,10,15,20,25,30,35,40,45,50,55,60,65,70),alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

8.2.1 Aljunied kernel density maps for Shared

Computing KDE

kde_share_Aljunied_bw <- density(shared_Aljunied_ppp , sigma=bw.diggle, edge=TRUE, kernel="gaussian") 
plot(kde_share_Aljunied_bw)

WARNNING: The land area of Aljunied is very small approximately 3km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

share_Aljunied_ppp.100m <- rescale(shared_Aljunied_ppp, 100, "m")
kde_share_Aljunied.bw <- density(share_Aljunied_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_share_Aljunied.bw)

gridded_kde_share_Aljunied_bw <- as.SpatialGridDataFrame.im(rescale(kde_share_Aljunied.bw, 1/100,"m"))
spplot(gridded_kde_share_Aljunied_bw)

kde_share_Aljunied_bw_raster <- raster(gridded_kde_share_Aljunied_bw)
kde_share_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : -6.431396e-18, 0.269812  (min, max)
projection(kde_share_Aljunied_bw_raster) <- CRS("+init=EPSG:3414")
kde_share_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : -6.431396e-18, 0.269812  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

8.2.2 Kernel density maps on openstreetmap of Singapore for Shared

tm_shape(kde_share_Aljunied_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

8.3.1 Aljunied kernel density maps for Hotel

Computing KDE

kde_hotel_Aljunied_bw <- density(hotel_Aljunied_ppp, sigma=bw.diggle, edge=TRUE, kernel="gaussian") 
plot(kde_hotel_Aljunied_bw)

WARNNING: The land area of Aljunied is very small approximately 3km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

hotel_Aljunied_ppp.100m <- rescale(hotel_Aljunied_ppp, 100, "m")
kde_hotel_Aljunied.bw <- density(hotel_Aljunied_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_hotel_Aljunied.bw)

gridded_kde_hotel_Aljunied_bw <- as.SpatialGridDataFrame.im(rescale(kde_hotel_Aljunied.bw, 1/100,"m"))
spplot(gridded_kde_hotel_Aljunied_bw)

kde_hotel_Aljunied_bw_raster <- raster(gridded_kde_hotel_Aljunied_bw)
kde_hotel_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : -1.998243e-15, 16.39803  (min, max)
projection(kde_hotel_Aljunied_bw_raster) <- CRS("+init=EPSG:3414")
kde_hotel_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : -1.998243e-15, 16.39803  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

8.3.2 Kernel density maps on openstreetmap of Singapore for Private

tm_shape(kde_hotel_Aljunied_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

8.4.1 Aljunied kernel density maps for Entire

Computing KDE

kde_entire_Aljunied_bw <- density(entire_Aljunied_ppp , sigma=bw.diggle, edge=TRUE, kernel="gaussian") 
plot(kde_entire_Aljunied_bw)

WARNNING: The land area of Aljunied is very small approximately 3km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

entire_Aljunied_ppp.100m <- rescale(entire_Aljunied_ppp, 100, "m")
kde_entire_Aljunied.bw <- density(entire_Aljunied_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_entire_Aljunied.bw)

gridded_kde_entire_Aljunied_bw <- as.SpatialGridDataFrame.im(rescale(kde_entire_Aljunied.bw, 1/100,"m"))
spplot(gridded_kde_entire_Aljunied_bw)

kde_entire_Aljunied_bw_raster <- raster(gridded_kde_entire_Aljunied_bw)
kde_entire_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : -2.742559e-15, 30.64161  (min, max)
projection(kde_entire_Aljunied_bw_raster) <- CRS("+init=EPSG:3414")
kde_entire_Aljunied_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 15.34011, 15.85319  (x, y)
## extent     : 32605.74, 34569.28, 31880.27, 33909.48  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : -2.742559e-15, 30.64161  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

8.4.2 Kernel density maps on openstreetmap of Singapore for Entire

tm_shape(kde_entire_Aljunied_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

8.5 Possible factors determine the spatial patterns

The location of the Aljunied might play a important factor in the listing. Even though in the map Aljunied is considered central part of the city, but there is not much attaction nearby. Therefore, it led to lesser hotel to open at the area. However, some families might still want to stay near to the town around with their family members but with budget contraint. Therefore, Aljunied might become one of their alternative option. However, sharing of room always the least favour out of all options, it might due to pravcy issue as most of people do not like to stay with strangers

9. Balestier Kernel Density Maps

9.1.1 Balestier kernel density maps for Private

Computing KDE

kde_private_Balestier_bw <- density(private_Balestier_ppp, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_private_Balestier_bw)

WARNNING: The land area of Balestier is very small approximately 2km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

private_Balestier_ppp.100m <- rescale(private_Balestier_ppp, 100, "m")
kde_private_Balestier.bw <- density(private_Balestier_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_private_Balestier.bw)

gridded_kde_private_Balestier_bw <- as.SpatialGridDataFrame.im(rescale(kde_private_Balestier.bw, 1/100,"m"))
spplot(gridded_kde_private_Balestier_bw)

kde_private_Balestier_bw_raster <- raster(gridded_kde_private_Balestier_bw)
kde_private_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : 5.264951e-08, 2.579471  (min, max)
projection(kde_private_Balestier_bw_raster) <- CRS("+init=EPSG:3414")
kde_private_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : 5.264951e-08, 2.579471  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

9.1.2 Kernel density maps on openstreetmap of Singapore for Private

tm_shape(kde_private_Balestier_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

9.2.1 Balestier kernel density maps for Hotel

Computing KDE

kde_hotel_Balestier_bw <- density(hotel_Balestier_ppp , sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_hotel_Balestier_bw)

WARNNING: The land area of Balestier is very small approximately 2km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

hotel_Balestier_ppp.100m <- rescale(hotel_Balestier_ppp, 100, "m")
kde_hotel_Balestier.bw <- density(hotel_Balestier_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_hotel_Balestier.bw)

gridded_kde_hotel_Balestier_bw <- as.SpatialGridDataFrame.im(rescale(kde_hotel_Balestier.bw, 1/100,"m"))
spplot(gridded_kde_hotel_Balestier_bw)

kde_hotel_Balestier_bw_raster <- raster(gridded_kde_hotel_Balestier_bw)
kde_hotel_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : 4.910162e-12, 2.310395  (min, max)
projection(kde_hotel_Balestier_bw_raster) <- CRS("+init=EPSG:3414")
kde_hotel_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : 4.910162e-12, 2.310395  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

9.2.2 Kernel density maps on openstreetmap of Singapore for hotel

tm_shape(kde_hotel_Balestier_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
## Warning: The shape mpsz is invalid. See sf::st_is_valid
## legend.postion is used for plot mode. Use view.legend.position in tm_view to set the legend position in view mode.
tmap_mode('plot')
## tmap mode set to plotting

9.3.1 Balestier kernel density maps for Entire

Computing KDE

kde_entire_Balestier_bw <- density(entire_Balestier_ppp , sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_entire_Balestier_bw)

WARNNING: The land area of Balestier is very small approximately 2km2. Therefore, we cannot rescale the size by 1000. An ideal rescale size would be 100m.

entire_Balestier_ppp.100m <- rescale(entire_Balestier_ppp, 100, "m")
kde_entire_Balestier.bw <- density(entire_Balestier_ppp.100m, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
plot(kde_entire_Balestier.bw)

gridded_kde_entire_Balestier_bw <- as.SpatialGridDataFrame.im(rescale(kde_entire_Balestier.bw, 1/100,"m"))
spplot(gridded_kde_entire_Balestier_bw)

kde_entire_Balestier_bw_raster <- raster(gridded_kde_entire_Balestier_bw)
kde_entire_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : NA 
## source     : memory
## names      : v 
## values     : -1.366179e-15, 16.93792  (min, max)
projection(kde_entire_Balestier_bw_raster) <- CRS("+init=EPSG:3414")
kde_entire_Balestier_bw_raster
## class      : RasterLayer 
## dimensions : 128, 128, 16384  (nrow, ncol, ncell)
## resolution : 18.93197, 10.39581  (x, y)
## extent     : 28807.86, 31231.15, 33417.93, 34748.59  (xmin, xmax, ymin, ymax)
## crs        : +init=EPSG:3414 +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs 
## source     : memory
## names      : v 
## values     : -1.366179e-15, 16.93792  (min, max)
tmap_mode('view')
## tmap mode set to interactive viewing

9.3.2 Kernel density maps on openstreetmap of Singapore for Entire

tm_shape(kde_entire_Balestier_bw_raster) +
  tm_raster("v",alpha = 0.7) +
  tm_layout(legend.position = c("right", "bottom"), frame = FALSE)+
  tm_shape(mpsz)+
  tm_polygons(alpha = 0)
tmap_mode('plot')
## tmap mode set to plotting

9.4 Possible factors determine the spatial patterns

The areas of Balestier are relatively small, along the main street of Balestier road are all shop houses. The number of residence units are much lesser compare to other residence areas. Within the Balestier areas, there are most or less developped and there not much change to attract more hotel business. In addition, all the residence areas are located near to each other. Therefore, in the spatial pattern for both private and entire are showing signs of clustering within the same location.