x <- runif(20, 0, 100)
y <- runif(20, 0, 100)
# Perfectly flat surface, rumple_index = 1
z <- rep(10, 20)
rumple_index(x, y, z)
# Rough surface, rumple_index > 1
z <- runif(20, 0, 10)
rumple_index(x, y, z)
# Rougher surface, rumple_index increases
z <- runif(20, 0, 50)
rumple_index(x, y, z)
# Measure of roughness is scale-dependent
rumple_index(x, y, z)
rumple_index(x/10, y/10, z)
z <- c(rnorm(1e4, 25, 6), rgamma(1e3, 1, 8)*6, rgamma(5e2, 5,5)*10)
z <- z[z<45 & z>0]
hist(z, n=50)
gapFraction = gap_fraction_profile(z)
plot(gapFraction, type="l", xlab="Elevation", ylab="Gap fraction")
z <- c(rnorm(1e4, 25, 6), rgamma(1e3, 1, 8)*6, rgamma(5e2, 5,5)*10)
z <- z[z<45 & z>0]
lad <- LAD(z)
plot(lad, type="l", xlab="Elevation", ylab="Leaf area density")
z <- runif(10000, 0, 10)
# expected to be close to 1. The highest diversity is given for a uniform distribution
entropy(z, by = 1)
z <- runif(10000, 9, 10)
# Must be 0. The lowest diversity is given for a unique possibility
entropy(z, by = 1)
z <- abs(rnorm(10000, 10, 1))
# expected to be between 0 and 1.
entropy(z, by = 1)
z <- runif(10000, 0, 10)
VCI(z, by = 1, zmax = 20)
z <- abs(rnorm(10000, 10, 1))
# expected to be closer to 0.
VCI(z, by = 1, zmax = 20)
Run the code above in your browser using DataLab