9999# ' [create_fia_ppp()]
100100# '
101101# ' @examples
102+ # ' # spatially explicit "stem-map model"
102103# ' calc_tcc_metrics(plantation)
104+ # '
105+ # ' # "FVS method" assuming random tree locations
106+ # ' calc_tcc_metrics(plantation, stem_map = FALSE)
107+ # ' @export
103108calc_tcc_metrics <- function (tree_list , stem_map = TRUE , full_output = TRUE ,
104109 digits = 1 ) {
105110
@@ -109,15 +114,13 @@ calc_tcc_metrics <- function(tree_list, stem_map = TRUE, full_output = TRUE,
109114 if (! (is.logical(full_output ) && length(full_output ) == 1 ))
110115 stop(" 'full_output' must be a single logical value" , call. = FALSE )
111116
112- X <- NULL # spatstat point pattern object
113117 L_mean <- NA_real_ # predictor variable based on Ripley's K
114118 if (stem_map ) {
115- # validate the input tree list for stem-mapping and get X
116- X <- create_fia_ppp(tree_list )
117-
118- # get estimate of the L-function (square root transform of Ripley's K)
119+ # validates the input tree list for stem-mapping and gets an estimate
120+ # of the L-function (square root transform of Ripley's K)
119121 # r = 0:12 feet
120- L <- spatstat.explore :: Lest(X , r = 0 : 12 )
122+ L <- create_fia_ppp(tree_list ) | > spatstat.explore :: Lest(r = 0 : 12 )
123+
121124 # mean of L at r = 6, 8, 10, 12 ft (Ripley's isotropic edge correction)
122125 L_mean <- mean(L $ iso [c(7 , 9 , 11 , 13 )])
123126 }
@@ -133,7 +136,7 @@ calc_tcc_metrics <- function(tree_list, stem_map = TRUE, full_output = TRUE,
133136
134137 model_tcc <- NA_real_
135138 if (stem_map ) {
136- # " stem-map" canopy cover model (Toney et al. 2009)
139+ # implement the stem-map canopy cover model (Toney et al. 2009)
137140
138141 # subplot and microplot crown overlays
139142 subp_overlay <- rep(NA_real_ , 4 )
0 commit comments