I was able to do an IDW ppp spatial interpolation in respect to a Datum level based on corresponding longitude, latitude coordinates for a grid I've specified. Although I achieve the desired plot, I am unsure how to input specific long-lat (x-y) coordinates and receive an interpolated Datum (z) level back.
The long (x), lat (y) and Datum (z) inputs from my df (dat) are below:
X_Point <- c(-9.15, 40.14, 56.25, 38.28, -19.53)
Y_Point <- c(46.58, 64.86, 26.87, -7.58, -19.6)
Z_Point <- c(17.1, 19.7, 18.9, 17, 16.1)
The code I currently have and reference output plot are also below:
obs_window <- owin(xrange=c(-20,60),yrange = c(-25,75))
GEO_Datum1<-ppp(dat$X_Point,dat$Y_Point,
marks=dat$Datum1,window=obs_window)
idw_GEO_Datum1 <- idw(GEO_Datum1, power=1, at="pixels")
plot(idw_GEO_Datum1,
col=heat.colors(20),
main="Interpolated Spatial Variation of Datum Level (m) based on IDW method \n (Power = 1)")
Completely unstuck as to what the next step in the process may be.