Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(raster)
- library(kriging)
- W <- shapefile('Mg_region.shp')
- x <- coord_na_removed[,2]
- y <- coord_na_removed[,1]
- z <- stations_fma_alt_jja
- data <- data.frame(x,y,z)
- coordinates(data) <- ~x+y
- # Generate Grid
- grd <- makegrid(W, n = 10000)
- colnames(grd) <- c('x','y')
- outline <- W@polygons[[1]]@Polygons[[1]]@coords
- require(splancs)
- W_grid <- grd[inout(grd,outline), ]
- gridded(W_grid) <- ~x+y
- krig <- autoKrige(z~1, data, W_grid)
- plot(krig)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement