I need to calculate the threshold, range and nugget from the raster layer. I studied gstat, usdm packages where you can create a semivariogram, but I can not find a function that sets the raster layer, it will evaluate these parameters. In most functions, these parameters must be defined, for example. krigging.
I have raster data layers for different heights that look like 
I would like to get the threshold, nugget and range from the semi-variance parameters set on these data layers to create a graph like this: 
Source data layers are available here as multi-band tiff. Here is a figure from this document that once again illustrates the concept.

r geospatial r-raster
Arihant
source share