guess_dbh_unit: Guess 'dbh' units based on minimum and maximum values of...

Description Usage Arguments Value Examples

Description

Guess dbh units based on minimum and maximum values of dbh.

Usage

1

Arguments

x

A numeric vector.

Value

A length-1 character string.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Case when
# min(x, na.rm = TRUE) < 1.1 &&
# max(x, na.rm = TRUE) < 500
guess_dbh_unit(c(1.0, 100))

# min is too large
try(guess_dbh_unit(c(1.2, 499)))
# max is too large
try(guess_dbh_unit(c(1.0, 501)))
# min is too large and max is too large
try(guess_dbh_unit(c(1.2, 501)))



# Case when
# min(x, na.rm = TRUE) > 9 &&
# max(x, na.rm = TRUE) > 500
guess_dbh_unit(c(9.1, 500.1))

# min is too small
try(guess_dbh_unit(c(8.9, 500.1)))
# max is too small
try(guess_dbh_unit(c(9.1, 500)))
# min is too small and max is too small
try(guess_dbh_unit(c(8.9, 500)))

forestgeo/fgeo.biomass documentation built on June 8, 2019, 10:47 p.m.