Skip to content

Commit 5490f66

Browse files
committed
small code linting and doc edits
1 parent 1cfe12a commit 5490f66

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

R/compute_ht_metrics.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
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
}

man/compute_ht_metrics.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)