forestgeo/fgeo.analyze

Fix docs abundance

maurolepore opened this issue · 1 comments

From forestgeo/forum#19 (comment):

"count woods" sounds weird. Maybe say "count individuals"?

I think vft2[2,3] should be 1.2, isn't it ?

would be good to show how to count abundance of stems and not only individual trees (e.i. a multi-stem tree with 2 stems counts for 2)

RE: forestgeo/forum#19 (comment):

"count woods" sounds weird. Maybe say "count individuals"?

I changed it to stems.

I think vft2[2,3] should be 1.2, isn't it?

It's confusing, I know. But no, the value 1.1 is correct. It intends to demonstrate the following:
...your data may have multiple stems per treeid and even multiple measures per stemid (when trees have buttressess).

vft2 <- tribble(
  ~CensusID, ~TreeID, ~StemID, ~DBH, ~HOM,
          1,     "1",   "1.1",   88,  130,
          1,     "1",   "1.1",   10,  160,
 )

would be good to show how to count abundance of stems and not only individual trees (e.i. a multi-stem tree with 2 stems counts for 2)

Thanks! I added the following example:

suppressPackageStartupMessages(library(fgeo))

# One stem per tree
abundance(
  tribble(
    ~TreeID, ~StemID, ~DBH,
        "1",   "1.1",   11,
        "2",   "2.1",   21
  )
)
#> # A tibble: 1 x 1
#>       n
#>   <int>
#> 1     2

# One tree with multiple stems
abundance(
  tribble(
    ~TreeID, ~StemID, ~DBH,
       "1",   "1.1",   11,
       "1",   "1.2",   12
  )
)
#> Warning: `treeid`: Duplicated values were detected. Do you need to pick
#> main stems?
#> # A tibble: 1 x 1
#>       n
#>   <int>
#> 1     2

# Similar but more realistic
stem <- fgeo.x::download_data("luquillo_stem5_random")

abundance(stem)
#> Warning: `treeid`: Duplicated values were detected. Do you need to pick
#> main stems?
#> # A tibble: 1 x 1
#>       n
#>   <int>
#> 1  1320

abundance(
  pick_main_stem(stem)
)
#> # A tibble: 1 x 1
#>       n
#>   <int>
#> 1  1000

Created on 2018-12-30 by the reprex package (v0.2.1)