r <- rast(ncol=100, nrow=100, crs="local", xmin=0, xmax=50, ymin=0, ymax=50)
set.seed(100)
x <- runif(25, 5, 45)
y <- runif(25, 5, 45)
z <- sample(25)
xyz <- cbind(x,y,z)
x <- interpIDW(r, xyz, radius=5, power=1, smooth=1, maxPoints=5)
Run the code above in your browser using DataLab