3

I have set of data frames and would like to use them to create one raster grid. Here are 2 example files: dat1 dat2

I use sp package to plot the spatial points:

library(raster)
library(sp)
coordinates(dat1) <- c("x", "y")
proj4string(dat1) <- CRS("+proj=longlat")
sp1 <- SpatialPoints(coords = dat1)
spplot(sp1) # example with the first data frame

How I can merge these points and fill the rest of the gaps with interpolation? plot

Geo-sp
  • 1,704
  • 3
  • 19
  • 42
  • I don't quite understand the phrase "fill as much as possible space". Do you just want to connect the fairly-obviously missing points? Or do you means something more elaborate? – Mike Wise Jan 04 '16 at 17:07
  • These files are data points, I want to merge these points and fill the gaps between them using kriging or similar methods. I can use arcmap to merge them and fill the gaps with nearest neighbor interpolation but I want to do that in R. I appreciate any suggestions. – Geo-sp Jan 04 '16 at 23:03
  • You probably need to ask this on the Cross Validated forum, and mention kriging in the title. While a lot of them are here too, you will get more responses there. – Mike Wise Jan 04 '16 at 23:07

2 Answers2

0

In R, you can merge the two dat sets (dat1 and dat2) into one file using the function rbind (). Then pick up the issue of filling the gaps between the points from there.

0

To get started, I would suggest looking at the examples in the documentation of the raster::interpolate methods, and have a look at the examples here: http://www.rspatial.org/analysis/rst/4-interpolation.html

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63