If you know how to program in R, you can do a R script for QGIS, there is some minor perks you need to do, but for that matter, SHP files can be understood as S4 type data, and you can build the script in R and then adapt the inputs and outputs in QGIS R console, or you can do the core script and then integrate in QGIS.
In order to make the variograms, you can use the variogram()
function to build the cloud and empirical variograms, and the fit.variogram()
function to fit your model into an specific covariance function in order to obtain the theoretical variogram, both are part of the gstat package.
The variogram()
function have an "alpha" argument where you can also model anisotropy by providing a vector with the angles, and also a "width" argument where you can provide the LAG distance. All this can be printed in the console results by adding ">" in the lines than you need to feed to the console.
For graphical results you can use the plot()
function from core R or ggplot()
from the ggplot2 package, both are compatible and usable in R QGIS console, but take into account than the tool can only provide inside QGIS the last plot, if you want several of them, then you need to use ggsave()
and provide a work directory to save into.
You can check an code example in here: QGIS/Rscripts/Variogram modeling
And you can look for console input/output calls in here: R Syntax Summary table for Processing (yeah, the QGIS versión is outdated, but the processing calls are still in use, and most of them are valid).
Variogram cloud
is available and it is a little bit hard to build variogram model from there. Most people would do it in R, but I recommend SAGA 6.3 which has fascinating interactive toolVariogram (Dialog)
.