1717# ' * `predomTreeHt`: predominant tree height, as the mean height of the tallest
1818# ' trees `>= 5.0` in. (`12.7` cm) diameter comprising up to `16` trees per
1919# ' acre (`39.5` trees per hectare)
20- # ' * `meanSapHt`: mean height of saplings (trees `>= 1.0` in. diameter but
21- # ' `< 5.0` in. diameter, i.e., `>= 2.54` cm but `< 12.7` cm)
20+ # ' * `meanSapHt`: mean height of saplings (trees `>= 1.0` in. but `< 5.0` in.
21+ # ' diameter, i.e., `>= 2.54` cm but `< 12.7` cm)
2222# ' * `maxSapHt`: height of the tallest sapling
2323# '
2424# ' For the purpose of height calculations, canopy dominant/co-dominant include
@@ -82,16 +82,16 @@ compute_ht_metrics <- function(tree_list, digits = 1) {
8282 if (nrow(trees_in ) > 0 ) {
8383 basal_area <- pi * (trees_in $ DIA / 2 )^ 2
8484 ht_metrics $ meanTreeHt <-
85- round(mean(tree_ht , na.rm = TRUE ), digits = digits )
85+ round(mean(tree_ht , na.rm = TRUE ), digits )
8686
8787 ht_metrics $ meanTreeHtBAW <-
8888 round(stats :: weighted.mean(tree_ht , basal_area , na.rm = TRUE ),
89- digits = digits )
89+ digits )
9090
9191 tree_ht_doms <- tree_ht [trees_in $ CCLCD %in% c(1 , 2 , 3 )]
9292 basal_area_doms <- basal_area [trees_in $ CCLCD %in% c(1 , 2 , 3 )]
9393 ht_metrics $ meanTreeHtDom <-
94- round(mean(tree_ht_doms , na.rm = TRUE ), digits = digits )
94+ round(mean(tree_ht_doms , na.rm = TRUE ), digits )
9595
9696 ht_metrics $ meanTreeHtDomBAW <-
9797 round(stats :: weighted.mean(tree_ht_doms , basal_area_doms ,
@@ -111,12 +111,12 @@ compute_ht_metrics <- function(tree_list, digits = 1) {
111111 if (tpa > 16 )
112112 break
113113 }
114- ht_metrics $ predomTreeHt <- round(sum_ht / n , digits = digits )
114+ ht_metrics $ predomTreeHt <- round(sum_ht / n , digits )
115115 }
116116
117117 if (nrow(saplings_in ) > 0 ) {
118118 ht_metrics $ meanSapHt <-
119- round(mean(sapling_ht , na.rm = TRUE ), digits = digits )
119+ round(mean(sapling_ht , na.rm = TRUE ), digits )
120120
121121 ht_metrics $ maxSapHt <- max(sapling_ht , na.rm = TRUE )
122122 }
0 commit comments