[R-sig-Geo] Input data for kriging with gstat
Pankaj Agarwal
p.agarwal at duke.edu
Tue May 19 20:54:23 CEST 2015
Hi,
I am working on preparing input data set for kriging using the gstat package in order to interpolate missing data values. Following along the example in the manual, I have been able to go through the steps with the meuse and meuse.grid data package. I am not sure how I would need to prepare my own data set for use in the function:
x <- krige(log(zinc)~1, meuse, meuse.grid, model = m, beta = 5.9)
Since the meuse and meuse.grid data set is used as is in the function, do I have to prepare my data set similar to these?
My data has level of measured air pollutant at the county centroid and the corresponding Long/Lat location. There are data for a few counties but missing for several, so I am trying to interpolate the missing values. I have already projected the Long/Lat using the rgdal package. Here is part of the data set that I have.
[1] 2.67190 2.67190 2.67190 3.12994 2.67190 2.87500 2.67190 NA NA NA......
Longitude Latitude
1 -76.94736 35.51745
2 -79.26456 35.73348
3 -78.71155 34.28487
4 -80.25679 36.10971
5 -77.10624 35.83633
6 -80.81196 35.21543
7 -78.97348 36.37938
8 -79.41320 36.07369
9 -81.19022 35.89239
10 -81.10411 36.49739
....
How would I convert or use my data set to an equivalent of meuse and meuse.grid so that I could use the "krige" and other functions.
Thank you,
- Pankaj
----------------------------------------------------------------
Pankaj Agarwal, M.S
Bioinformatician
Database Analyst II
Surgical Sciences Applied Therapeutics Section
Department of Surgery
Duke University
919-244-6389
p.agarwal at duke.edu<mailto:p.agarwal at duke.edu>
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list