swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: bb7c67ff9d4495b607d15ae6e52e18b7796d7c35 authored by Edzer Pebesma on 19 October 2022, 08:45:08 UTC
version 2.1-0
version 2.1-0
Tip revision: bb7c67f
na.action.R
library(sp)
data(meuse)
data(meuse.grid)
set.seed(13131) # reproduce results
# select 10 random rows;
# create two missing values in the coordinates:
m = meuse.grid[sample(nrow(meuse.grid), 10), ]
m[c(2,8), "x"] = NA
library(gstat)
## this is not allowed anymore:
try(krige(log(zinc)~1,~x+y,meuse,m, na.action = na.pass))
try(krige(log(zinc)~1,~x+y,meuse,m, na.action = na.omit))
try(krige(log(zinc)~1,~x+y,meuse,m, na.action = na.exclude))
try(krige(log(zinc)~1,~x+y,meuse,m, na.action = na.fail))
# select 10 random rows;
# create two missing values in the regressor variable:
m = meuse.grid[sample(nrow(meuse.grid), 10), ]
m[c(3,7), "dist"] = NA
krige(log(zinc)~dist,~x+y,meuse,m, na.action = na.pass)
krige(log(zinc)~dist,~x+y,meuse,m, na.action = na.omit)
krige(log(zinc)~dist,~x+y,meuse,m, na.action = na.exclude)
try(krige(log(zinc)~dist,~x+y,meuse,m, na.action = na.fail))