|
1 | 1 | #' Predict plot-level canopy cover from individual tree measurements |
2 | 2 | #' |
3 | 3 | #' `calc_tcc_metrics()` computes plot-level predicted tree canopy cover (TCC) |
4 | | -#' from tree list data. A full set of stand structure components used to derive |
5 | | -#' the plot-level prediction are included in the output by default (see |
| 4 | +#' from tree list data. By default, a full set of stand structure components |
| 5 | +#' used to derive the plot-level TCC prediction are included in the output (see |
6 | 6 | #' Details). |
7 | 7 | #' |
8 | 8 | #' @details |
9 | | -#' This function supports two alternative methods for predicting plot-level TCC. |
10 | | -#' |
11 | | -#' The default method requires individual tree coordinates to be provided in the |
12 | | -#' input, as distance and azimuth from subplot centers for trees with diameter |
13 | | -#' \verb{>= 5 in.} (12.7 cm), or from microplot centers for "sapling" trees with |
14 | | -#' diameter \verb{>= 1 in.} (2.54 cm) but \verb{< 5 in.} (12.7 cm). This method |
15 | | -#' involves spatially explicit stem-mapping to account for crown overlap of the |
16 | | -#' mature trees, along with empirical modeling of the understory sapling |
17 | | -#' contribution to total canopy cover (Toney et al. 2009). The empirical model |
18 | | -#' for the sapling component also uses overstory tree point pattern as one of |
19 | | -#' its predictor variables (based on Ripley's K function, Ripley 1977). |
| 9 | +#' This function provides two methods for predicting plot-level TCC. |
| 10 | +#' |
| 11 | +#' The default "stem-map" method requires individual tree coordinates to be |
| 12 | +#' included in the input as distance and azimuth from subplot centers for trees |
| 13 | +#' with diameter \verb{>= 5 in.} (12.7 cm), and from microplot centers for |
| 14 | +#' "saplings" having diameter \verb{>= 1 in.} (2.54 cm) but \verb{< 5 in.} |
| 15 | +#' (12.7 cm). This method involves mapping trees spatially to account for crown |
| 16 | +#' overlap, along with empirical modeling of the understory sapling contribution |
| 17 | +#' to total canopy cover (Toney et al. 2009). The empirical model for the |
| 18 | +#' sapling component also uses the overstory tree point pattern as a predictor |
| 19 | +#' variable (based on Ripley's K function, Ripley 1977). |
20 | 20 | #' |
21 | 21 | #' Alternatively, plot-level TCC can be predicted using a simplified approach |
22 | 22 | #' that does not include exact stem placement (`stem_map = FALSE`). A random |
23 | 23 | #' arrangement of stems is assumed in that case. This is the method used to |
24 | | -#' estimate percent canopy cover in the Forest Vegetation Simulator (Crookston |
25 | | -#' and Stage 1999). |
| 24 | +#' estimate tree canopy cover in the Forest Vegetation Simulator (Crookston and |
| 25 | +#' Stage 1999). |
26 | 26 | #' |
27 | | -#' The stem-map method requires computation of several stand structure metrics |
28 | | -#' which are components of the overall model used to derive the plot-level TCC |
29 | | -#' estimate. These include: |
| 27 | +#' Both methods require estimates of individual tree crown width, which are |
| 28 | +#' computed with `calc_crwidth()` if not provided in the input tree list. |
| 29 | +#' |
| 30 | +#' The stem-map method also requires computation of several stand structure |
| 31 | +#' metrics, which are components of the overall model used to derive a |
| 32 | +#' plot-level TCC estimate. These additional variables include: |
30 | 33 | #' |
31 | | -#' * individual tree crown widths via `calc_crwidth()` (if not provided in the |
32 | | -#' input tree list) |
33 | 34 | #' * individual subplot and microplot crown overlays via `calc_crown_overlay()` |
34 | 35 | #' * a stand height metric (`meanTreeHtBAW`) via `calc_ht_metrics()` |
35 | 36 | #' * plot-level counts of mature trees and saplings |
36 | | -#' * descriptive statistics for the tree spatial point pattern via |
| 37 | +#' * descriptive spatial statistics for the overstory tree point pattern via |
37 | 38 | #' `create_fia_ppp() |> spatstat.explore::Lest()` |
38 | 39 | #' |
39 | 40 | #' |
|
46 | 47 | #' the input data frame will have the columns specified in |
47 | 48 | #' [DEFAULT_TREE_COLUMNS] (see `?DEFAULT_TREE_COLUMNS`). Potentially, only a |
48 | 49 | #' subset of those columns will be needed depending on values given for the |
49 | | -#' arguments `stem_map`, `full_output` and `crwidth_col` described below. |
| 50 | +#' arguments `stem_map` and `full_output` described below. If the input data |
| 51 | +#' frame has a column named `"CRWIDTH"` it will be used for tree crown width |
| 52 | +#' values, otherwise, crown widths will be calculated with a call to |
| 53 | +#' `calc_crwidth()`. |
50 | 54 | #' @param stem_map A logical value indicating whether to map individual trees |
51 | 55 | #' explicitly using coordinates specified in terms of distance and azimuth from |
52 | 56 | #' subplot/microplot centers. The default is `TRUE`, in which case the input |
|
59 | 63 | #' output list includes subplot-level TCC estimates, live tree and sapling |
60 | 64 | #' counts, stand height metrics, and point pattern statistics, depending on the |
61 | 65 | #' value given for `stem_map` (see Details). |
62 | | -#' @param crwidth_col The name of a column in `tree_list` containing the |
63 | | -#' individual tree crown widths (case-sensitive). Defaults to `"CRWIDTH"`. If |
64 | | -#' the given column name does not exist in the input data frame, or this |
65 | | -#' argument is set to `NULL`, then crown widths will be computed with a call to |
66 | | -#' `calc_crwidth()`. |
67 | 66 | #' @param digits Optional integer indicating the number of digits to keep in the |
68 | 67 | #' return values (defaults to `1`). May be passed to `calc_crwidth()` and |
69 | 68 | #' `calc_ht_metrics()`. |
|
85 | 84 | #' Statistical Society: Series B (Methodological)_, 39(2): 172–192. |
86 | 85 | #' \url{https://doi.org/10.1111/j.2517-6161.1977.tb01615.x}. |
87 | 86 | #' |
88 | | -#' Toney, C, J.D. Shaw and M.D. Nelson. 2009. A stem-map model for predicting |
| 87 | +#' Toney, C., J.D. Shaw and M.D. Nelson. 2009. A stem-map model for predicting |
89 | 88 | #' tree canopy cover of Forest Inventory and Analysis (FIA) plots. In: |
90 | 89 | #' McWilliams, Will; Moisen, Gretchen; Czaplewski, Ray, comps. _Forest Inventory |
91 | 90 | #' and Analysis (FIA) Symposium 2008_; October 21-23, 2008; Park City, UT. Proc. |
|
98 | 97 | #' [create_fia_ppp()] |
99 | 98 | #' |
100 | 99 | calc_tcc_metrics <- function(tree_list, stem_map = TRUE, full_output = TRUE, |
101 | | - crwidth_col = "CRWIDTH", digits = 1) { |
| 100 | + digits = 1) { |
| 101 | + |
| 102 | + if (!(is.logical(stem_map) && length(stem_map) == 1)) |
| 103 | + stop("'stem_map' must be a single logical value", call. = FALSE) |
| 104 | + |
| 105 | + if (!(is.logical(full_output) && length(full_output) == 1)) |
| 106 | + stop("'full_output' must be a single logical value", call. = FALSE) |
| 107 | + |
| 108 | + X <- NULL # spatstat point pattern object |
| 109 | + if (stem_map) { |
| 110 | + # validate the input tree list for stem-mapping and get X |
| 111 | + X <- create_fia_ppp(tree_list) |
| 112 | + } |
102 | 113 |
|
| 114 | + ht_metrics <- NULL |
| 115 | + if (stem_map || full_output) { |
| 116 | + # validate the input tree list for stand height calc and get metrics |
| 117 | + ht_metrics <- calc_ht_metrics() |
| 118 | + } |
103 | 119 |
|
| 120 | + if (!("CRWIDTH" %in% colnames(tree_list))) |
| 121 | + tree_list$CRWIDTH <- calc_crwidth(tree_list) |
104 | 122 |
|
105 | 123 |
|
| 124 | + # estimate of the L-function (Besag's transformation of Ripley's K) for |
| 125 | + # r = 0:12 feet |
| 126 | + if (stem_map) { |
| 127 | + L <- spatstat.explore::Lest(X, r = 0:12) |
| 128 | + # mean of L at r = 6, 8, 10, 12 ft (Ripley's isotropic edge correction) |
| 129 | + L_mean <- mean(L$iso[c(7, 9, 11, 13)]) |
| 130 | + } |
106 | 131 |
|
107 | 132 | } |
0 commit comments