'gstat package is not returning NA

I'm estimating the value of rainfall in one of the unknown locations with the gstat package.
I'm merely testing these codes to show that the 'gstat' package returns an estimated value even when the 'nmin' nmax and'maxdist' parameters aren't met. The codes should return 'NA'.
I have three neighbouring stations that are 97.51, 37.45, and 50.94 kilometres from the location of the point of interest. Do you have any recommendations?

library(gstat)
library(sp)

Rainfall = data.frame(x = c(-47.6, -48.9, -48.2, -48.9, -47.6, -48.6), 
                      y = c(-23.4, -24.0, -23.9, -23.1, -22.7, -22.5), 
                      Rain = c(27.0,  33.4,  34.6,  18.2,   30.8, 42.8))

sp = Rainfall
coordinates(sp) = ~x+y
xi = c(-48.0530600)
yi = c(-23.5916700)
grid = expand.grid (xi=xi ,yi=yi)
coordinates(grid) = ~xi + yi
idw(sp$Rain~1, sp, grid, nmin=2,nmax=3, maxdist=25)

[inverse distance weighted interpolation]
class       : SpatialPointsDataFrame 
features    : 1 
extent      : -48.05306, -48.05306, -23.59167, -23.59167  (xmin, xmax, ymin, ymax)
crs         : NA 
variables   : 2
names       :        var1.pred, var1.var 
value       : 32.2319969930987,       NA 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source