@@ -89,6 +89,9 @@ process_tree_data <- function(tree_table, stem_map = TRUE, full_output = TRUE,
8989 tree_list <- tree_table [tree_table $ PLT_CN == plot_ids [1 ], ]
9090 x <- calc_tcc_metrics(tree_list , stem_map , full_output , digits , window = w )
9191
92+ cli :: cli_alert_info(
93+ " The input table contains tree data for {.val {num_plots}} plots." )
94+
9295 out <- vector(" list" , 1 + length(x ))
9396 names(out ) <- c(" PLT_CN" , names(x ))
9497
@@ -109,10 +112,14 @@ process_tree_data <- function(tree_table, stem_map = TRUE, full_output = TRUE,
109112 out [[j ]] <- rep_len(NA_real_ , num_plots )
110113 }
111114
112- cli :: cli_alert_info(
113- " The input table contains tree data for {.val {num_plots}} plots." )
115+ cli :: cli_progress_bar(
116+ " Processing..." ,
117+ format_done = paste0(
118+ " {cli::col_green(cli::symbol$tick)} Processed " ,
119+ " {.val {cli::pb_total}} plots in {cli::pb_elapsed}." ),
120+ total = num_plots ,
121+ clear = FALSE )
114122
115- cli :: cli_progress_bar(" Processing..." , total = num_plots )
116123 for (i in seq_along(plot_ids )) {
117124 tree_list <- tree_table [tree_table $ PLT_CN == plot_ids [i ], ]
118125 x <- calc_tcc_metrics(tree_list , stem_map , full_output , digits ,
@@ -124,7 +131,6 @@ process_tree_data <- function(tree_table, stem_map = TRUE, full_output = TRUE,
124131 cli :: cli_progress_update()
125132 }
126133 cli :: cli_progress_done()
127- cli :: cli_alert_info(" Done." )
128134
129135 as.data.frame(out )
130136}
0 commit comments