I don't know how to generate the graph file from either one of these:
africa = read_sf("combined.shp")
##africa=readOGR("combined.shp")
##africa <- shapefile("combined.shp")
this will not work
f(region2,model="bym",graph="africa")
sometimes this function is used:
nb2INLA package:spdep R Documentation
Output spatial neighbours for INLA
Description:
Output spatial neighbours for INLA
Usage:
nb2INLA(file, nb)
Arguments:
file: file where adjacency matrix will be stored
nb: an object of class ‘nb’