Skip to content

Commit c8b6f62

Browse files
committed
update readme [no chk]
1 parent 9286537 commit c8b6f62

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

README.Rmd

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ pak::pak("firelab/FIAstemmap")
4747

4848
### Predict tree crown width
4949

50-
The data frame `cw_coef` contains a curated set of linear regression coefficients for predicting crown width from stem diameter of tree species in the conterminous US (see `?cw_coef`). The method for crown width prediction attempts to avoid extrapolation beyond the range of the model fitting data by providing reasonable fall backs for the obvious cases. Details are given in the documentation for `calc_crwidth()`. The input is a data frame of tree records which must have columns `SPCD` (FIA species code), `STATUSCD` (FIA tree status code, `1` = live) and `DIA` (FIA tree diameter). The `plantation` dataset used here is an example tree list included in the package.
50+
The data frame `cw_coef` contains a curated set of linear regression coefficients for predicting crown width from stem diameter of tree species in the conterminous US (see `?cw_coef`). The method for crown width prediction attempts to avoid extrapolation beyond the range of the model fitting data by providing reasonable fall backs for the obvious cases. Details are given in the documentation for `calc_crwidth()`. The input is a data frame of tree records which must have columns `SPCD` (FIA species code), `STATUSCD` (FIA tree status code, `1` = live) and `DIA` (FIA tree diameter). FIA distribute data using US customary units with `DIA` given in inches, tree height in feet, etc. Convenience functions are provided for converting to and from SI units (`in_to_cm()`, `cm_to_in()`, `ft_to_m()`, `m_to_ft()`).
51+
52+
The `plantation` dataset used here is an example tree list included in the package.
5153

5254
```{r predict-crwidth}
5355
library(FIAstemmap)
@@ -57,7 +59,7 @@ library(FIAstemmap)
5759
head(cw_coef)
5860
5961
# Add a column of predicted crown widths to the `plantation` tree list.
60-
# `within()` modifies a copy of the example dataset.
62+
# The base R function `within()` modifies a copy of the example dataset.
6163
tree_list <- within(plantation, CRWIDTH <- calc_crwidth(plantation))
6264
str(tree_list)
6365
```
@@ -101,13 +103,18 @@ The `western_redcedar` dataset is another example tree list included in the pack
101103

102104
```{r spatstat-explore-cont}
103105
## Spatial point pattern for the western redcedar tree list.
106+
107+
# Give stem distances in meters.
108+
trees <- within(western_redcedar, DIST <- ft_to_m(DIST))
109+
110+
X <- create_fia_ppp(trees, linear_unit = "m")
104111
X <- create_fia_ppp(western_redcedar)
105112
summary(X)
106113
107114
plot(X, pch = 16, background = "#fdf6e3",
108115
main = "Western redcedar point pattern")
109116
110-
K <- spatstat.explore::Kest(X, rmax = 12, correction = "isotropic")
117+
K <- spatstat.explore::Kest(X, rmax = ft_to_m(12), correction = "isotropic")
111118
112119
plot(K, main = "Ripley's K for the western redcedar FIA plot")
113120
```

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ model fitting data by providing reasonable fall backs for the obvious
6868
cases. Details are given in the documentation for `calc_crwidth()`. The
6969
input is a data frame of tree records which must have columns `SPCD`
7070
(FIA species code), `STATUSCD` (FIA tree status code, `1` = live) and
71-
`DIA` (FIA tree diameter). The `plantation` dataset used here is an
72-
example tree list included in the package.
71+
`DIA` (FIA tree diameter). FIA distribute data using US customary units
72+
with `DIA` given in inches, tree height in feet, etc. Convenience
73+
functions are provided for converting to and from SI units
74+
(`in_to_cm()`, `cm_to_in()`, `ft_to_m()`, `m_to_ft()`).
75+
76+
The `plantation` dataset used here is an example tree list included in
77+
the package.
7378

7479
``` r
7580
library(FIAstemmap)
@@ -86,7 +91,7 @@ head(cw_coef)
8691
#> 6 ABMA 20 California red fir <NA> 6.67 0.43 0.00 Gill et al. (2000)
8792

8893
# Add a column of predicted crown widths to the `plantation` tree list.
89-
# `within()` modifies a copy of the example dataset.
94+
# The base R function `within()` modifies a copy of the example dataset.
9095
tree_list <- within(plantation, CRWIDTH <- calc_crwidth(plantation))
9196
str(tree_list)
9297
#> 'data.frame': 91 obs. of 13 variables:
@@ -189,6 +194,11 @@ the package.
189194

190195
``` r
191196
## Spatial point pattern for the western redcedar tree list.
197+
198+
# Give stem distances in meters.
199+
trees <- within(western_redcedar, DIST <- ft_to_m(DIST))
200+
201+
X <- create_fia_ppp(trees, linear_unit = "m")
192202
X <- create_fia_ppp(western_redcedar)
193203
summary(X)
194204
#> Planar point pattern: 24 points
@@ -217,7 +227,7 @@ plot(X, pch = 16, background = "#fdf6e3",
217227

218228
``` r
219229

220-
K <- spatstat.explore::Kest(X, rmax = 12, correction = "isotropic")
230+
K <- spatstat.explore::Kest(X, rmax = ft_to_m(12), correction = "isotropic")
221231

222232
plot(K, main = "Ripley's K for the western redcedar FIA plot")
223233
```
-2.71 KB
Loading

0 commit comments

Comments
 (0)