All Questions
103 questions
3
votes
1
answer
2k
views
R kriging raster returns NA for some prediction points?
I am trying to interpolate a raster layer of chlorophyll-a data using kriging (gstat::krige) in R, however the resulting interpolation is showing NA values in a peculiar straight line through the ...
0
votes
1
answer
449
views
0........0.kriging error messages, grid file problem ? (automap, gstat)
I am trying to conduct kriging of variable called percent in South Africa.
head(LL12)
Location Longitude Latitude percent
1 L1 16.48476 -28.60737 1.0000000
2 L3 16....
0
votes
1
answer
185
views
Error message with Krige function: Error in as.character.default(X[[i]], ...) : no method for coercing this S4 class to a vector
I am trying to run the Krige function but I keep receiving NA values for var1.pred and var1.var. After using the warning() command, it says: Error in as.character.default(X[[i]], ...) :
no method for ...
1
vote
1
answer
229
views
Kriging with gstat and Gaussian model produces bad outputs
I am trying to produce kriging models from elevations points using the gstat package. I can fit models to the empirical variogram using exponential, spherical, and Gaussian curves. However, despite ...
0
votes
1
answer
232
views
Spatio-temporal Kriging and how extract specific values
I have several years of data that needs to be converted to STDFDF.
Shapiro.test and Adf.test talk about non-stationarity and non-normal distribution.
particolato_May2021 <- read.delim(file = "...
0
votes
1
answer
428
views
R function krige.cv() returns NAs
I recently completed a geostatistics course, and now trying to apply my knewly acquired knowledge to a real case.
I have a dataset with 2 122 groundwater level measurement points. I would like to ...
-1
votes
1
answer
247
views
Performing empirical bayesian kriging in R
I am trying to apply empirical bayesian kriging in R, but I cannot find a package that provides a function for EBK.
Does anyone know of any or should I use ArcGIS?
3
votes
0
answers
750
views
Spatial interpolation of climate data using latitude, longitude and elevation in r
I have downloaded E-OBS gridded daily climate data on 0.1-degree grid. For each grid point, I have longitude, latitude, elevation and climate data, i.e. precipitation sum / mean temperature. Now, I ...
11
votes
2
answers
5k
views
R gstat krige() - Covariance matrix singular at location [5.88,47.4,0]: skipping
When I want to perform the kriging it only works sometimes, depending on what values I use in my datatable. As a result of the krige function I get for var1.pred: NA NA NA ... and var1.var: NA NA NA .....
0
votes
0
answers
52
views
Clip a SpatialGrid using a SpatialPolygon
In order to perform kriging methods using automap::autoKrige I need to provide a SpatialGrid for which values can be predicted. I would like to reduce the rectangular grid to the actual area (in this ...
1
vote
1
answer
75
views
Improving kriging results from transect data
I have estimates of fish density along transects from a lake and would like to extrapolate these estimates for the entire lake surface, using kriging methods. Based on information from here, here and ...
0
votes
0
answers
60
views
Unexpected artifacts when creating a digital terrain model (DTM) using lidR and gstat libraries in R
I'm using the lidR, raster, sp, and gstat libraries in R to create a Digital Terrain Model (DTM) from LiDAR data. I'm encountering unexpected artifacts in my DTM and I'm unsure why.
Here is my code:
...
1
vote
0
answers
52
views
Generate simulations using variogram with given mean and standard deviation
I am trying to generate simulations using variogram using the R code below
library(sp)
library(gstat)
library(ggplot2)
library(tidyverse)
library(dplyr)
library(reshape2)
# Call data
points <- ...
1
vote
1
answer
77
views
Kriging: extract data for other unknown points
I have one month of data that I converted to STDFDF.
#set the spatial location of the regions
Data.loc <- data.frame(Stat = c("Firmo","Citta dei Ragazzi", "Rende",
...
0
votes
0
answers
45
views
How to stack/merge geom_stars items/plots in one - in R
If I have plotted the Relative Error Maps for the Silt soil attribute for the following 4 different soil types: Cambisols, calcisols, leptosols and fluvisols that form my study case area:
ggplot() +
...
0
votes
0
answers
241
views
Spatial Outliers Detection and Remove in R?
I have run my data in R, and created a distribution mapof my data (Clay Soil Property).
I want to detect in a way the spatial outliers that i can see from the map, and remove them in order to execute ...
0
votes
0
answers
242
views
How to create a Grid in R for Kriging
I have done my work for creating variograms etc, and i would like to run kriging. I've loaded my dataset, and i know that i should create a grid file, but i don't know how.
I have the shapefile from ...
0
votes
1
answer
94
views
Using a dynamic formula with parrallel kringing in R
I am trying to achieve parallel Kriging in R on several variables using a loop. Here is a reproducible example using data meuse and a code for parallel kriging that I found here. In the code below, ...
8
votes
2
answers
2k
views
Interpolating Maps - Statistical Learning Techniques vs Spatial Statistics Techniques
I have recently begun experimenting with the interpolation of variables over a whole country.
I have good sized training set where I have several dependent variables (continuous and categorical) ...
0
votes
1
answer
572
views
Ordinary Kriging: "Warning message: In fit.variogram(data.var, vgm("Mat")) : No convergence after 200 iterations: try different initial values?"
I am trying to fit a variogram for kriging using the sp and gstat packages in r, but when I fit the variogram using a mattern fit, I get this warning message:
Warning message:
In fit.variogram(data....
1
vote
1
answer
491
views
R - Why are my kriged interpolation values so low when using ordinary kriging (gstat)?
I am using a synthetic dataset that I generated for the purposes of fulfilling an assignment. I am attempting to use ordinary kriging to interpolate point data across an entire field, but my ...
1
vote
1
answer
475
views
Kriging with gstat package in R produces empty interpolation points
I have kriged a dataset with the gstat package in R, but it has produced an empty variable as a result. I have 1,167 measurement points within a field, and I am trying to interpolate them across 3,464 ...
0
votes
1
answer
193
views
Adding kriging results back to a GWR model in R?
How can I add the kriging results of a downscaling process back to a GWR model? Basically, I have 2 raster, 1 at 400m (let's call it x1) resolution and 1 at 100m resolution. I upscaled the latter to ...
8
votes
3
answers
3k
views
Backtransformation of kriging predictions and variances
I'm not sure how to back-transform log-normal kriged results. This example using the "meuse" data shows how to make variogram and use it to get kriging predictions (and variances) using the popular '...
1
vote
1
answer
462
views
Export kriging plot as GeoTIFF
I have performed kriging and plotted it with ggplot, now I want to load the plot in QGIS. For that to work I need a GeoTIFF file of my plot. How do I convert my plot into a GeoTIFF file?
EDIT: added ...
5
votes
0
answers
536
views
Dealing with duplicate locations when kriging by replacing them with single location taking mean of duplicates using R [duplicate]
I understand that the existence of duplicate points (locations) when Kriging will result in a singular covariance matrix. The only way I've encountered people dealing with this is to keep the first of ...
1
vote
0
answers
2k
views
Validation of Regression Kriging [closed]
I am interested in exploring the idea of generating a predictive model for a target variable in a spatial context. I would then like to correct the residuals of this model using kriging, i.e. in a ...
1
vote
1
answer
1k
views
Interpolating DEM using Kriging in R [closed]
I have several DEMs as geotiff files which I load into R using raster::raster. Now some of these DEMs contain patches of missing values, represented by NA. I would like to interpolate these missing ...
6
votes
2
answers
5k
views
Three-dimensional interpolation of temperature profiles using gstat in R?
I'm working on a problem in which I'd like to interpolate a set of oceanographic temperature profiles over a three-dimensional matrix of unsampled x, y, & z locations. The data to interpolate is ...
2
votes
1
answer
773
views
Fitting a variogram for Kriging in R
I want to fit a variogram of my data for kriging.
Here is what I have so far:
library(sp)
library(rgdal)
require(gstat)
setwd("C:/Users/49151/Desktop")
#import data
data <- read.csv(&...
1
vote
1
answer
1k
views
Plotting a heatmap of Kriging with coordinate in R
I performed Kriging in R. But I have trouble getting a plot of a colored heatmap showing the resulted interpolated area along with a lon/lat values at the side and on the button.
Here is an example, ...
1
vote
0
answers
117
views
Why can't gstat::krige accept duplicate locations when universal kriging?
Let us create a simple simulation worthy of gstat::krige with universal kriging, in the language of linear mixed models, i.e.:
Where X is a n x n_vars matrix of n_vars additional variables, betas is ...
0
votes
0
answers
506
views
Ordinary kriging is not working in QGIS 3.20 & SAGA-7.2.0
I am using below data for making kriging interpolation.
structure(list(Serial = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L, 13L, 14L, 17L, 18L, 24L, 28L, 30L, 31L, 36L, 37L,
43L, 44L, 46L, ...
15
votes
3
answers
20k
views
Converting point data into gridded dataframe for histogram analysis using R?
I am very new at using GIS data and only modestly experienced with R. I've been reading about how to analyze spatial data using the spatial-analyst.net PDF book, so I'm not completely lost, but I ...
11
votes
1
answer
986
views
Kriging on GRASS+R - cannot allocate vector of size 146.5 Mb
I'm trying to do a groundwater elevation map with an Ordinary Kriging on R, but always resulting on the lack of memory
cannot allocate vector of size 146.5 Mb
allocation (windows xp 32bit). ...
1
vote
1
answer
266
views
Kriging for unevenly spaced points using R?
I started to read about Kriging and the implementation into R. In all the tutorials I found, a (regular) grid is used to do ordinary or universal kriging. My situation is as follows, I try to ...
1
vote
0
answers
184
views
NAN's in the kriging predictions in R
I am trying to perform the kriging prediction of my data.
I follow a pretty standard process.
Firstly, I prep a grid to which the kriging predictions are supposed to be inserted.
I prep data that I ...
0
votes
0
answers
24
views
Warning message while kriging in R [duplicate]
krig_Gaussian<-krige(formula=(B)~1, locations=Amb_m, newdata=gd_m, model=model_Gaussian.variog_m)
[using ordinary kriging]
Warning messages:
1: In proj4string(d$data) :
CRS object has comment, ...
1
vote
0
answers
180
views
Upper and lower bounds from gstat::krige() and gstat::idw()
Is it possible to obtain lower and upper bound values from a kriging estimation using gstat::krige() in the same way it can be obtained from a simple lm() model?
The following lm() example comes from ...
1
vote
1
answer
683
views
IDW/Kriging running slow in R
I have a dataset with 2157335 entries, and I am performing IDW/Kriging to interpolate.
But the code is running very slow. I am not sure this is because of a large dataset or there is something wrong ...
1
vote
1
answer
586
views
Interpolated map using pca axes
I have done between group pca in R. I want to make an interpolated map using the eigen values of the first three pc axes.
I want to produce a map using each of the three pc axes and finally combine ...
3
votes
1
answer
1k
views
How to create a grid to do kriging interpolation that correspond to areas in a map having actual observations?
I need to do kriging interpolation but wanted to have the interpolation in areas where I have actual data; not across the whole map.
This is my example.
Here is the base map (shp file in a .zip file): ...
2
votes
1
answer
705
views
Why krige function return all NA's values for the prediction when trying to interpolate a variable?
I am trying to build a map with kriging interpolation for a variable. When running the krige function the return is all NA values and the kriged map plot only one value. I couldn't find out why and I ...
0
votes
1
answer
810
views
Latin Hypercube Sampling (LHS) in R
I am new to R and would like to generate Latin Hypercube samples (LHS) for three variables within the following limts:
1.25 ≤ x1 ≤ 5 ,
1.25 ≤ x2 ≤ 5
7 ≤ x1 ≤ 25
with total 3*10 = 30 samples.
What ...
0
votes
0
answers
803
views
Interpolating SpatialPointsDataFrame to RasterLayer using autoKrige in R
I have a SpatialPointsDataFrame with elevation data and 51'257 elements. I also have a RasterLayer object of dimensions c(114,210) covering roughly the same area (all the spatial points are within the ...
3
votes
1
answer
666
views
Variogram fit won't converge
I am having some difficulty fitting a variogram to the data provided at the end of this post. For context, this is baseball data where the x and z coordinates are for the location of the pitch and the ...
3
votes
0
answers
59
views
Performing meaningful kriging in R (averaging nearby points) [closed]
I have a set of data on the quantitative composition of the particle size distribution of the sedimentary layer. I have to build a map of the distribution of certain fractions across the entire study ...
1
vote
0
answers
166
views
Raster distortion from parallel kriging in R
I am relatively new to parallel computing in R. I am using a high performance cluster to perform kriging for soil data points. I found this previous post which I used as a template:
How to achieve ...
0
votes
0
answers
110
views
Cokriging cross validation variances too small?
I'm looking into kriging the Meuse dataset in R. I first performed ordinary kriging using copper, using krige.cv to calculate residuals. The distribution of prediction variances given by applying ...
0
votes
1
answer
2k
views
After I give kring command, this error comes up: data item in gstat object and newdata have different coordinate reference systems
> library(gstat)
> library(readxl)
> library(sp)
> library(rgdal)
#2013(FATALITIES)
data <- read.csv("C:/Users/sbs/Desktop/Study/RA/Accident analysis/New folder/Iowa total crashes ...