# NOT RUN {
# Load sample data
library(ForestTools)
library(sp)
data("kootenayTrees", "kootenayBlocks", "kootenayCrowns")
# Get total tree count
SpatialStatistics(kootenayTrees)
# Get total tree count, tree height and crown area statistics
SpatialStatistics(kootenayCrowns, variables = c("height", "crownArea"))
# Get tree count, height statistics for specific areas of interest
areaStats <- SpatialStatistics(kootenayTrees, areas = kootenayBlocks, variables = "height")
# Plot according to tree count
plot(areaStats, col = heat.colors(3)[order(areaStats$TreeCount)])
# Get tree count and height statistics for a 20 x 20 m spatial grid
gridStats <- SpatialStatistics(kootenayTrees, grid = 20, variables = "height")
# Plot gridded tree count and statistics
plot(gridStats$TreeCount)
plot(gridStats$heightMax)
# }
Run the code above in your browser using DataLab