gstat is an R package for spatial and spatio-temporal geostatistical modelling, prediction and simulation
Questions tagged [gstat]
130 questions
12
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
- 387
- 2
- 5
- 16
8
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,704
- 3
- 19
- 42
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
- 314
- 5
- 19
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
- 744
- 1
- 12
- 36
5
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
- 385
- 3
- 16
4
votes
2 answers
Different outcomes from autokriging and manual kriging
Can someone help me understand why I am getting such different results from auto- and manual kriging? I see the two algorithms are using different variogram models, but is that alone the reason for all the discrepancy? I am also uncomfortable with…

Manojit
- 611
- 1
- 8
- 18
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,502
- 5
- 25
- 37
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,818
- 17
- 62
- 97
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
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
- 348
- 5
- 14
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
- 144
- 1
- 9
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
- 387
- 2
- 5
- 16
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,704
- 3
- 19
- 42
3
votes
1 answer
Time taken to krige in gstat package in R
The following R program creates an interpolated surface using 470 data points using walker Lake data in gstat package.
source("D:/kriging/allfunctions.r") # Reads in all functions.
source("D:/kriging/panel.gamma0.r") # Reads in…

Chandan
- 764
- 2
- 8
- 21
2
votes
0 answers
Variogram with time series data
I want to check the results of my lme-model for temporal autocorrelation. The data can be downloaded here (password: Variogram_2023). It contains the sampling date, group and extracted residuals from the model (E1). These residuals derived from an…

M.Teich
- 575
- 5
- 22