Here is my dput:
structure(list(longitude = c(-87.7225799560547, -88.207893371582,
-85.7975158691406, -85.7160568237305, -85.5187377929688, -86.2476654052735,
-86.6500701904297, -85.2413940429688, -87.9522247314453, -86.165901184082,
-87.8308181762695, -87.7894744873047, -87.5250015258789, -85.8040924072266,
-85.6926651000977, -87.2973098754883, -85.94091796875, -86.3146896362305,
-87.6543884277344, -87.3110504150391), latitude = c(30.7275810241699,
31.4076194763184, 32.8624153137207, 32.1004600524902, 33.6745567321777,
32.9362373352051, 32.1547889709473, 31.5147228240967, 32.853199005127,
33.3800506591797, 31.6766681671143, 32.2476501464844, 33.2895469665527,
34.4598236083984, 32.385986328125, 33.8033485412598, 31.8023834228516,
33.7156867980957, 34.9015426635742, 34.52197265625), cyear = c("1003-2000",
"1129-2000", "1123-2000", "1011-2000", "1029-2000", "1037-2000",
"1085-2000", "1067-2000", "1063-2000", "1121-2000", "1025-2000",
"1091-2000", "1125-2000", "1049-2000", "1087-2000", "1127-2000",
"1109-2000", "1115-2000", "1077-2000", "1079-2000")), row.names = c(NA,
-20L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x7fc0578114e0>)
I am wondering how to create a spatial weights matrix from point coordinates "longitude" and "latitude" using "cyear" as my spatial unit of observations. I haven't found much online in terms of how to do this aside from first converting the coordinates in this dataframe into polygons, which leads to some errors for me. Is anyone generous enough to write some code such that the following dput can have a spatial weights matrix created from it? Thank you!