createcanopy: Create the canopy

Description Usage Arguments Value Examples

View source: R/createcanopy.R

Description

Create a vertical projection of the the crown of each tree

Usage

1
createcanopy(inventory)

Arguments

inventory

Input inventory containing the crown diameter (CrownDiameter, in m) (calculable with the addtreedim function) of each tree (data.frame)(see the inputs formats and metadata in the vignette)

Value

A dataframe with a column 'Crowns' containing the circles (sfc_POLYGON) as trees crown, with their diameter filled in, representing trees from the sky.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(Paracou6_2016)
Paracou6_2016 <- dplyr::slice(Paracou6_2016, 1:10) # inventory reduction

inventory <- addtreedim(inventorycheckformat(Paracou6_2016),
volumeparameters = ForestZoneVolumeParametersTable)

inventory <- createcanopy(inventory)

# The small ones first so that they are plotted below the big ones
inventory <- dplyr::arrange(inventory, TreeHeight)

library(ggplot2)
ggplot() +
  geom_sf(data = getgeometry(inventory, Crowns),
          aes(alpha = TreeHeight),
          fill = "forestgreen") +
          labs(alpha = "Tree height")

thomasgaquiere/Maria documentation built on Dec. 24, 2021, 1:20 a.m.