@@ -74,8 +74,8 @@ dataset used here is an example tree list included in the package.
7474``` r
7575library(FIAstemmap )
7676
77- # regression coefficients for estimating crown width from diameter are included
78- # see `?cw_coef`
77+ # Regression coefficients for estimating crown width from diameter are included.
78+ # See `?cw_coef`.
7979head(cw_coef )
8080# > symbol SPCD common_name surrogate b0 b1 b2 reference
8181# > 1 ABAM 11 Pacific silver fir <NA> 7.30 0.59 0.00 Bechtold (2004)
@@ -85,8 +85,8 @@ head(cw_coef)
8585# > 5 ABLA 19 subalpine fir <NA> 3.96 0.64 0.00 Bechtold (2004)
8686# > 6 ABMA 20 California red fir <NA> 6.67 0.43 0.00 Gill et al. (2000)
8787
88- # add a column of predicted crown widths to the `plantation` tree list
89- # `within()` modifies a copy of the example dataset
88+ # Add a column of predicted crown widths to the `plantation` tree list.
89+ # `within()` modifies a copy of the example dataset.
9090tree_list <- within(plantation , CRWIDTH <- calc_crwidth(plantation ))
9191str(tree_list )
9292# > 'data.frame': 91 obs. of 13 variables:
@@ -113,7 +113,7 @@ data with individual stem locations given in columns named `AZIMUTH`
113113(distance from subplot/microplot center).
114114
115115``` r
116- # display modeled tree crowns projected vertically on the FIA plot boundary
116+ # Display modeled tree crowns projected vertically on the FIA plot boundary.
117117plot_crowns(tree_list , main = " Loblolly pine plantation" )
118118```
119119
@@ -146,7 +146,7 @@ computation of descriptive spatial statistics, and other exploratory
146146data analysis.
147147
148148``` r
149- # create a spatstat point pattern object for the plantation tree list
149+ # # Create a spatstat point pattern object for the pine plantation tree list.
150150X <- create_fia_ppp(plantation )
151151summary(X )
152152# > Planar point pattern: 89 points
@@ -167,45 +167,84 @@ summary(X)
167167# > Unit of length: 1 foot
168168# > Fraction of frame area: 0.124
169169
170- plot(X , pch = 16 , background = " #fdf6e3" , main = " plantation point pattern" )
170+ plot(X , pch = 16 , background = " #fdf6e3" ,
171+ main = " Pine plantation point pattern" )
171172```
172173
173174<img src =" man/figures/README-spatstat-explore-1.png " alt =" " width =" 70% " />
174175
175176``` r
176177
177- # compute Ripley's K-function applying isotropic edge correction
178+ # Compute Ripley's K-function applying isotropic edge correction.
178179K <- spatstat.explore :: Kest(X , rmax = 12 , correction = " isotropic" )
179180
180- # plot estimated K(r) along with theoretical values for a random point process,
181- # suggesting spatial regularity in this case
182- plot(K , main = " Ripley's K for the plantation trees " )
181+ # Plot estimated K(r) along with theoretical values for a random point process,
182+ # suggesting spatial regularity in this case.
183+ plot(K , main = " Ripley's K for the plantation FIA plot " )
183184```
184185
185186<img src =" man/figures/README-spatstat-explore-2.png " alt =" " width =" 70% " />
186187
188+ ``` r
189+
190+ # # Spatial point pattern for the western redcedar tree list.
191+ X <- create_fia_ppp(western_redcedar )
192+ summary(X )
193+ # > Planar point pattern: 24 points
194+ # > Average intensity 0.00331562 points per square foot
195+ # >
196+ # > Coordinates are given to 15 decimal places
197+ # >
198+ # > Window: polygonal boundary
199+ # > 4 separate polygons (no holes)
200+ # > vertices area relative.area
201+ # > polygon 1 360 1809.62 0.25
202+ # > polygon 2 360 1809.62 0.25
203+ # > polygon 3 360 1809.62 0.25
204+ # > polygon 4 360 1809.62 0.25
205+ # > enclosing rectangle: [-127.921, 127.921] x [-84.001, 144.001] feet
206+ # > (255.8 x 228 feet)
207+ # > Window area = 7238.47 square feet
208+ # > Unit of length: 1 foot
209+ # > Fraction of frame area: 0.124
210+
211+ plot(X , pch = 16 , background = " #fdf6e3" ,
212+ main = " Western redcedar point pattern" )
213+ ```
214+
215+ <img src =" man/figures/README-spatstat-explore-3.png " alt =" " width =" 70% " />
216+
217+ ``` r
218+
219+ K <- spatstat.explore :: Kest(X , rmax = 12 , correction = " isotropic" )
220+
221+ plot(K , main = " Ripley's K for the western redcedar FIA plot" )
222+ ```
223+
224+ <img src =" man/figures/README-spatstat-explore-4.png " alt =" " width =" 70% " />
225+
187226### Compute stand structure metrics
188227
189228``` r
190- # # compute fractional tree canopy cover of a specific sampled area by overlaying
191- # # modeled crowns
229+ # # Compute fractional tree canopy cover of a specific sampled area by overlaying
230+ # # modeled crowns.
192231
193- # subplot 1 of the plantation plot (subplot radius 24 ft)
194- # omit saplings which are only sampled in the microplot
232+ # Subplot 1 of the plantation plot (subplot radius 24 ft).
233+ # Omit saplings which are only sampled in the microplot.
195234# visualized with: `plot_crowns(tree_list, subplot = 1)`
196235tree_list [tree_list $ SUBP == 1 & tree_list $ DIA > = 5 , ] | >
197236 calc_crown_overlay(sample_radius = 24 )
198237# > [1] 86.8
199238
200- # # calculate stand height metrics, which are also included by default in the
201- # # output of `calc_tcc_metrics()` (see below)
239+ # # Calculate stand height metrics, which are also included by default in the
240+ # # output of `calc_tcc_metrics()` (see below).
202241
203242# compute stand height metrics only
204243# calc_ht_metrics(plantation)
205244
206- # # predict plot-level canopy cover from individual tree measurements
245+ # # Predict plot-level canopy cover from individual tree measurements.
207246
208- # by default, TCC is predicted using the "stem-map" model, full output returned
247+ # By default, TCC is predicted using the "stem-map" model, full output returned.
209248calc_tcc_metrics(plantation )
210249# > $model_tcc
211250# > [1] 88.4
@@ -282,25 +321,25 @@ calc_tcc_metrics(plantation)
282321# > $maxSapHt
283322# > [1] 43
284323
285- # return only the predicted TCC value (`$model_tcc`)
324+ # Return only the predicted TCC value (`$model_tcc`).
286325calc_tcc_metrics(plantation , full_output = FALSE )
287326# > [1] 88.4
288327
289- # using the "FVS method", which assumes that trees are randomly located
328+ # Using the "FVS method", which assumes that trees are randomly located.
290329calc_tcc_metrics(plantation , stem_map = FALSE , full_output = FALSE )
291330# > [1] 81.4
292331```
293332
294333### Data processing
295334
296335``` r
297- # load tree data from a file or database connection
298- # Lolo NF, single-condition forest plots, INVYR 2022, from public FIADB
336+ # Load tree data from a file or database connection.
337+ # Lolo NF, single-condition forested plots, INVYR = 2022, from public FIADB
299338f <- system.file(" extdata/mt_lnf_2022_1cond_tree.csv" , package = " FIAstemmap" )
300339tree_table <- load_tree_data(f )
301- # > ! the data source does not have DIST and/or AZIMUTH
302- # > ℹ Fetching tree data...
303- # > ✔ Fetching tree data. [14ms]
340+ # > ! The data source does not have DIST and/or AZIMUTH.
341+ # > ℹ Fetching tree data
342+ # > ✔ Fetching tree data [14ms]
304343# >
305344# > ℹ 910 tree records returned.
306345
0 commit comments