Skip to content

Commit 2076fb6

Browse files
committed
add usage examples [WIP]
1 parent 16890e9 commit 2076fb6

1 file changed

Lines changed: 59 additions & 2 deletions

File tree

README.Rmd

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ The Forest Inventory and Analysis Program ([FIA](https://research.fs.usda.gov/pr
3131
* mapping erosion risk [[11]](#references)
3232
* assessment of tree canopy cover estimation methods [[12, 13]](#references)
3333

34+
Note that analysis or computation based on tree spatial pattern within a plot require input data with coordinates of individual stems given as aziumuth and distance from the sample center point. FIA no longer provide `AZIMUTH` and `DIST` attributes in the publicly available FIADB `TREE` table. The FIADB User Guide states that these attributes are now available by request from [FIA Spatial Data Services](https://research.fs.usda.gov/programs/fia/sds) [[14]](#references). Tree data without stem locations can be used in **FIAstemmap** with reduced functionality which includes predicting individual tree crown width and computing several stand structure metrics.
35+
3436
## Installation
3537

3638
You can install the development version of **FIAstemmap** with:
@@ -42,13 +44,66 @@ pak::pak("ctoney/FIAstemmap")
4244

4345
## Examples
4446

45-
TODO...
47+
### Predict crown width
48+
49+
The data frame `cw_coef` provides a curated set of linear regression coefficients for predicting crown width from stem diameter of tree species in the conterminous US. The crown width prediction method also addresses potential issues in cases of extrapolation beyond the range of the model fitting data. Details are given in the documentation for `calc_crwidth()`. Input is a data frame of tree records which must have columns `SPCD` (FIA integer species code), `STATUSCD` (FIA integer tree status code, `1` = live) and `DIA` (FIA tree diameter in inches), here using the `plantation` example tree list.
4650

4751
```{r example}
4852
library(FIAstemmap)
49-
## basic example code
53+
54+
# structure of the cw_coef dataset
55+
str(cw_coef)
56+
57+
# add a column of predicted crown width to the plantation tree list
58+
# `within()` is used to modify only a copy of the example dataset
59+
tree_list <- within(plantation, CRWIDTH <- calc_crwidth(plantation))
60+
str(tree_list)
61+
```
62+
63+
### Exloratory analysis
64+
65+
Plot-level visualization and other exploratory analyses require input data with stem locations provided in columns `AZIMUTH` (horizontal angle from subplot/microplot center to the stem location, in range `0:359`) and `DIST` (stem distance from subplot/microplot center).
66+
67+
```{r example}
68+
# display modeled tree crowns projected vertically on boundaries of the FIA
69+
# four-subplot cluster design
70+
plot_crowns(tree_list, main = "plantation plot")
71+
72+
# individual subplot
73+
plot_crowns(tree_list, subplot = 4, main = "plantation subplot 4")
74+
75+
# or microplot
76+
plot_crowns(tree_list, subplot = 4, microplot = TRUE,
77+
main = "plantation microplot 4")
5078
```
5179

80+
Helper functions are provided to facilitate analyzing FIA tree lists as Spatial Point Patterns using the **spatstat** library. `create_fia_ppp()` returns an object of class `"ppp"` representing the point pattern of an FIA tree list in the 2-D plane. This object can be used with functions of package **spatstat.explore** for additional plotting capabilty, computation of descriptive spatial statistics, and other exploratory data analysis.
81+
82+
```{r example}
83+
# point pattern object for the plantation tree list
84+
X <- create_fia_ppp(plantation)
85+
summary(X)
86+
87+
plot(X, pch = 16, main = "Loblolly pine plantation")
88+
89+
# compute Ripley's K-function applying isotropic edge correction
90+
K <- spatstat.explore::Kest(X, rmax = 12, correction = "isotropic")
91+
92+
# plot estimated values of K(r) along with theoretical values for a completely
93+
# random (Poisson) point process, suggestng spatial regularity in this case
94+
plot(K, main = "Ripley's K for the plantation trees")
95+
```
96+
97+
### Compute stand structure metrics
98+
99+
100+
101+
102+
### Data processing
103+
104+
105+
106+
52107
## References
53108

54109
[1] Toney, Chris; Shaw, John D.; Nelson, Mark D. 2009. A stem-map model for predicting tree canopy cover of Forest Inventory and Analysis (FIA) plots. In: McWilliams, Will; Moisen, Gretchen; Czaplewski, Ray, comps. _Forest Inventory and Analysis (FIA) Symposium 2008_; October 21-23, 2008; Park City, UT. Proc. RMRS-P-56CD. Fort Collins, CO: U.S. Department of Agriculture, Forest Service, Rocky Mountain Research Station. 19 p. Available: https://research.fs.usda.gov/treesearch/33381.
@@ -77,3 +132,5 @@ _Ecological Indicators_, Volume 142, 109271, https://doi.org/10.1016/j.ecolind.2
77132
[12] Riemann, R., Liknes, G., O'Neil-Dunne, J., Toney, C., Lister, T. (2016). Comparative assessment of methods for estimating tree canopy cover across a rural-to-urban gradient in the mid-Atlantic region of the USA. _Environmental Monitoring and Assessment_, 188, 297, https://doi.org/10.1007/s10661-016-5281-8.
78133

79134
[13] Andrew N. Gray, Anne C.S. McIntosh, Steven L. Garman, Michael A. Shettles. 2021. Predicting canopy cover of diverse forest types from individual tree measurements. _Forest Ecology and Management_, Volume 501, 119682, ISSN 0378-1127, https://doi.org/10.1016/j.foreco.2021.119682.
135+
136+
[14] Burrill, Elizabeth A.; DiTommaso, Andrea M.; Turner, Jeffery A.; Pugh, Scott A.; Christensen, Glenn; Kralicek, Karin M.; Perry, Carol J.; Lepine, Lucie C.; Walker, David M.; Conkling, Barbara L. 2024. The Forest Inventory and Analysis Database, FIADB user guides, volume: database description (version 9.4), nationwide forest inventory (NFI). U.S. Department of Agriculture, Forest Service. 1016 p. [Online]. Available at: https://research.fs.usda.gov/understory/forest-inventory-and-analysis-database-user-guide-nfi.

0 commit comments

Comments
 (0)