For the work, we have to load the following libraries:
packages <- c("terra", "tidyverse", "dplyr")
The process requires collecting sub-district wise data on households with no phone or landline. The data is available from SECC census 2011 for the sub-districts. The data is saved in a csv format,merged to the sub-district shapefile and rasterised.
deprv_noph <- read.csv("state/assam_sub_district_deprv_noph.csv")
districts <- vect("ASSAM_SUBDISTRICT_4326.shp")
distr_deprv_noph <- merge(districts, deprv_noph, by='OBJECTID')
var <- rast("state/pop_ind_ppp_2011_UNadj.tif")
distr_deprv_noph$noph <- as.numeric(distr_deprv_noph$noph)
## Warning: NAs introduced by coercion
distr_deprv_noph$nophnum <- distr_deprv_noph$noph
#rasterise the secc data - no landline or mobile phone (no_ph) data
no_ph <- rast(nrow = nrow(var), ncol = ncol(var))
ext(no_ph) <- ext(var)
res(no_ph) <- res(var)
crs(no_ph) <- crs(var)
no_ph <- rasterize(distr_deprv_noph, no_ph, 'nophnum')
plot(no_ph, main = "Distribution of population with no phone or landline")
writeRaster(no_ph,"outputs_vulnerability/State_noph.tif", overwrite = T)
The data on no phone or landline is available as a percentage. The rasterised image of the socio-economic variable multiplied with the population gives the number of people with no phone or landline.
#assuming number of ppl with no_ph grows in the same rate the population grows
year <- 2015:2022
norm_map <- function(yr){
#yr <- 2015
var <- rast(sprintf("state/pop_ind_ppp_%s_UNadj.tif",yr))
var <- var*no_ph
plot(var, main = sprintf("Households with no phone or landline in %s",yr))
return(var)
}
#calling the function
layermaps <- sapply(year, norm_map)
Finally, all the generated maps are saved.