Learn R Programming

habtools (version 1.1.1)

entropy_2d: 2D Entropy

Description

Calculates 2D entropy.

Usage

entropy_2d(data, bw, grid_size, relative = FALSE, add_max = FALSE)

Value

entropy value

Arguments

data

data.frame with two columns for x and y coordinates.

bw

Bandwidth to use in 2D kernel density estimator.

grid_size

Size of binning grid, in the unit of the data.

relative

Logical. Rescale entropy relative to the maximum entropy given the number of grid cells? Defaults to FALSE.

add_max

Logical. Add the maximum entropy as a return?

References

X. Liu, Q. Ma, X. Wu, T. Hu, Z. Liu, L. Liu, Q. Guo, Y. Su (2022). A novel entropy-based method to quantify forest canopy structural complexity from multiplatform lidar point clouds. Remote Sens. Environ. 282, 113280.

Examples

Run this code
dta <- data.frame(x = rnorm(100,5,1), y = rnorm(100,5,1))
entropy_2d(dta, bw = 0.5, 0.25)
entropy_2d(dta, bw = 0.5, 0.25, relative = TRUE)
dta <- data.frame(x = runif(100, 1,10), y = runif(100, 1,10))
entropy_2d(dta, bw = 0.5, 0.25)
entropy_2d(dta, bw = 0.5, 0.25, relative = TRUE)

Run the code above in your browser using DataLab