43,61c43,89
< > ## Not run: 
< > ##D # Construct a small raster file containing realizations of normal random variables:
< > ##D a <- raster::raster(matrix(rnorm(648), 18, 36))
< > ##D raster::plot(a)
< > ##D # Calculate contrast:
< > ##D contrast_a <- strucDiv(a, wsl = 3, fun = contrast)
< > ##D raster::plot(contrast_a)
< > ##D 
< > ##D # Calculate dissimilarity:
< > ##D b <- raster::raster(matrix(rnorm(100), 10, 10))
< > ##D raster::plot(b)
< > ##D dissim_b <- strucDiv(b, wsl = 5, angle = "horizontal", fun = dissimilarity)
< > ##D raster::plot(dissim_b)
< > ##D 
< > ##D # Calculate structural diversity entropy with delta = 2 on NDVI data binned to 15 gray levels
< > ##D ndvi.15gl <- raster::raster(ndvi.15gl)
< > ##D sde_ndvi15 <- strucDiv(ndvi.15gl, wsl = 3, fun = entropy, delta = 2)
< > ##D raster::plot(sde_ndvi15)
< > ## End(Not run)
---
> > # Construct a small raster file containing realizations of normal random variables:
> > a <- raster::raster(matrix(rnorm(648), 18, 36))
> > raster::plot(a)
> > # Calculate contrast:
> > contrast_a <- strucDiv(a, wsl = 3, fun = contrast, na.handling = na.omit, rank = FALSE)
> Extracting values from raster file
> Calculating gray level co-occurrence matrix
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> Calculating horizontal structural diversity
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> > raster::plot(contrast_a)
> > 
> > # Calculate dissimilarity:
> > b <- raster::raster(matrix(rnorm(100), 10, 10))
> > raster::plot(b)
> > dissim_b <- strucDiv(b, wsl = 5, dist = 1, angle =  "all", fun = dissimilarity, 
> +     na.handling = na.pass, rank = FALSE)
> Extracting values from raster file
> Calculating gray level co-occurrence matrix
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> **************************************************************Calculating horizontal structural diversity
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> **************************************************************> raster::plot(dissim_b)
> > 
> > # Calculate structural diversity entropy with delta = 2 on NDVI data binned to 15 gray levels
> > ndvi.15gl <- raster::raster(ndvi.15gl)
> > sde_ndvi15 <- strucDiv(ndvi.15gl, wsl = 3, fun = entropy, delta = 2, na.handling = na.pass, 
> +     rank = FALSE)
> Extracting values from raster file
> Calculating gray level co-occurrence matrix
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> Calculating horizontal structural diversity
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> > raster::plot(sde_ndvi15)
> > 
79,89c107,112
< > ## Not run: 
< > ##D # Calculate entropy on simulated random patch data
< > ##D a <- raster::raster(matrix(rnorm(100), 10, 10))
< > ##D sdivDom <- strucDivDom(a, angle = "vertical", fun = entropyDom)
< > ##D # Structural diversity value of the domain
< > ##D div <- sdivDom$div
< > ##D # Gray level co-occurrence matrix
< > ##D glcm <- sdivDom$GLCM
< > ##D # Diversity matrix
< > ##D divmat <- sdivDom$divMat
< > ## End(Not run)
---
> > # Calculate entropy on NDVI data binned to 15 gray levels
> > ndvi15 <- raster::raster(ndvi.15gl)
> > ndvi15Dom <- strucDivDom(ndvi15, fun = entropyDom)
> > ndvi15GLCM <- ndvi15Dom$GLCM
> > ndvi15Div <- ndvi15Dom$div
> > 
106,125c129,170
< > ## Not run: 
< > ##D # Construct a small raster file containing realizations of normal random variables:
< > ##D a <- raster::raster(matrix(rnorm(400), 20, 20))
< > ##D raster::plot(a)
< > ##D # Calculate structural diversity entropy with delta = 2, double moving window scheme
< > ##D sde_1 <- strucDivNest(a, wslI = 3, wslO = 5, angle = "horizontal", fun = entropy, delta = 2)
< > ##D raster::plot(sde_1)
< > ##D 
< > ##D # Calculate structural diversity entropy with delta = 1, block nesting scheme 
< > ##D b <- raster::raster(matrix(rnorm(2500), 50, 50))
< > ##D raster::plot(b)
< > ##D sde_b <- strucDivNest(b, wslI = 3, dimB = c(10, 10), oLap = 4, priorB = TRUE, fun = entropy, 
< > ##D     delta = 1)
< > ##D raster::plot(sde_b)
< > ##D 
< > ##D # Calculate entropy on simulated random patch, domain nesting scheme 
< > ##D patch <- raster::raster(patch)
< > ##D entropy_patch <- strucDivNest(patch, wslI = 5, domain = TRUE, angle = "vertical", fun = entropy)
< > ##D raster::plot(entropy_patch)
< > ## End(Not run)
---
> > # Construct a small raster file containing realizations of normal random variables:
> > a <- raster::raster(matrix(rnorm(648), 18, 36))
> > raster::plot(a)
> > # Calculate structural diversity entropy with delta = 2, double moving window scheme
> > sde_a <- strucDivNest(a, wslI = 3, wslO = 7, fun = entropy, delta = 2, na.handling = na.omit, 
> +     rank = FALSE)
> Extracting values from raster file
> Calculating gray level co-occurrence matrix
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> Calculating horizontal structural diversity
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> > raster::plot(sde_a)
> > 
> > # Calculate structural diversity entropy with delta = 1, block nesting scheme 
> > b <- raster::raster(matrix(rnorm(2500), 50, 50))
> > raster::plot(b)
> > sde_b <- strucDivNest(b, wslI = 3, dimB = c(10, 10), oLap = 4, priorB = TRUE, fun = entropy, 
> +     delta = 1, na.handling = na.pass, rank = FALSE)
> 
>   |                                                                            
>   |                                                                      |   0%
> > raster::plot(sde_b)
> > 
> > # Calculate entropy on NDVI data binned to 15 gray levels, domain nesting scheme 
> > ndvi.15gl <- raster::raster(ndvi.15gl)
> > entropyNest_ndvi15 <- strucDivNest(ndvi.15gl, wslI = 5, domain = TRUE, fun = entropy, 
> +     na.handling = na.pass, rank = FALSE)
> Extracting values from raster file
> Calculating gray level co-occurrence matrix
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> Calculating horizontal structural diversity
> 0%   10   20   30   40   50   60   70   80   90   100%
> [----|----|----|----|----|----|----|----|----|----|
> **************************************************|
> > raster::plot(entropyNest_ndvi15)
> >