Questions tagged [gstat]

gstat is an R package for spatial and spatio-temporal geostatistical modelling, prediction and simulation

108 questions
9
votes
3 answers

Create Grid in R for kriging in gstat

lat long 7.16 124.21 8.6 123.35 8.43 124.28 8.15 125.08 Consider these coordinates, these coordinates correspond to weather stations that measure rainfall data. The intro to the gstat package in R uses the meuse dataset. At some point…
ace_01S
  • 327
  • 2
  • 5
  • 12
7
votes
1 answer

Regression kriging of binomial data

I use gstat to predict a binomial data, but the predicted values go above 1 and below 0. Does anyone know how I can deal with this issue? Thanks. data(meuse) data(meuse.grid) coordinates(meuse) <- ~x+y coordinates(meuse.grid) <-…
Geo-sp
  • 1,542
  • 2
  • 18
  • 41
6
votes
1 answer

How to back transform normal score transformed data

I have daily rainfall from 61 gauging stations for 12 years in a catchment(8000 Km2). The goal is create 5Km and 25 Km resolution gridded daily rainfall product. As the no of stations are small and not all stations have rain even in rainy season, i…
user1142937
  • 294
  • 5
  • 17
6
votes
1 answer

heatmap on ggmap error and best practice

I want to plot a heatmap on a ggmap. library(ggmap) turku<-get_map('turku', zoom=13) turkumap<-ggmap(turku, extent="device", legend="topleft") turkumap turkumap+geom_density2d(mapping=aes(x = lon, y = lat),data = test, ) the error i get…
Irene
  • 704
  • 1
  • 9
  • 35
4
votes
2 answers

Error in performing the krige function of gstat in R

I want to perform the ordinary kriging by using gstat package. I have only 17 location which is not sufficient for OK so, I have used also the temporal data of each node as a ancillary data to build the variogram. However, I came up with this error…
A.Amidi
  • 2,412
  • 2
  • 22
  • 35
4
votes
1 answer

How to make Ordinary Kriging by using gstat predict

I am trying to write a code in R that use gstat library in order to create an interpolation. I have already read the gstat manual and based on some examples on internet I had managed to write this code (this is only a part): g <- gstat(id="tec",…
user1919
  • 3,422
  • 13
  • 50
  • 85
3
votes
1 answer

How to apply a Function on a List of Lists in R?

I am trying to write a loop where I apply a function to a list of lists. I want to interpolate the temperatures (max mean temperature/MAXMEAN) of different countries with the idw command of the gstat package. The idw function needs the information…
Lisa
  • 33
  • 4
3
votes
1 answer

Universal kriging using lat long gstat R

I'm new at R and I'm having some trouble to perform a universal kriging with gstat R. As Hengl et al. (2004) say "Universal kriging should be reserved for the case where the drift (or trend) is modelled as a function of the coordinates only". So, I…
Fjord
  • 85
  • 1
  • 7
3
votes
2 answers

Underlay a vector image to a grid for kriging in R

After searching around a lot, asking, and doing some code, I kinda got the bare minimum for doing kriging in R's gstat. Using 4 points (I know, totally bad), I kriged the unsampled points located between them. But in actuality, I don't need all of…
ace_01S
  • 327
  • 2
  • 5
  • 12
3
votes
2 answers

Merge spatial points and use interpolation to fill the gaps

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) <-…
Geo-sp
  • 1,542
  • 2
  • 18
  • 41
2
votes
0 answers

How do I ensure a 3D synthetic random field reproduces its variogram using R gstat

I have attempted to generate a 3D synthetic spatial random field using unconditional simulation in R gstat; with the lines below. However, my attempts to check if the exhaustive data can reproduce the variogram used in generating the field have been…
TTOWG
  • 31
  • 2
2
votes
1 answer

Loop variable IDW gstat R

Is there a way to loop over variables inside an SpatialPointsDataFrame object in R using IDW interpolation of gstat package ? I mean something like this for (day in list_days) { P.idw <- gstat::idw(day~1, P, newdata=grd, idp=2.0) r <-…
Forever
  • 225
  • 2
  • 14
2
votes
0 answers

Variogram Iteration Warning

I would like to perform kriging using a variable call "Secchi.Disk" from a data set I have. However, when fitting the variogram I get the following warming message Warning message: In fit.variogram(v, vgm(0.5, "Sph", 40, 0.5)) : No convergence…
Perro
  • 286
  • 2
  • 13
2
votes
1 answer

Whats the difference between z~1 and z~LON+LAT in plotting variogram in R?

library(sp) data(meuse) coordinates(meuse)<-~x+y v<-variogram(log(zinc)~1,meuse) v np dist gamma dir.hor dir.ver id 1 57 79.29244 0.1234479 0 0 var1 2 299 163.97367 0.2162185 0 0 var1 3 …
Orpheus
  • 309
  • 5
  • 21
2
votes
1 answer

Finding nearest grid value in spatial dataframe in R

I am learning about spatial dataframes. I have created a simple example that uses inverse distance weighting (IDW) to interpolate values across a grid, based on an initial set of points. I would now like to obtain the interpolated value for each of…
user1885116
  • 1,601
  • 3
  • 22
  • 38
1
2 3 4 5 6 7 8