st_coordinates()
sf
inla()
Straightforward function is the nb2mat() function (not in the book).
nb2mat()
It converts the ‘sparse’ neighbours list to a square neighbourhood matrix of weights.