Description Usage Arguments Value Examples
Converts NatureServ S ranks to a number from 0
("SX"
) to 5
("S5"
).
Historic ("SH"
) is converted to 0.5
(i.e., halfway between 0
and 1
).
When there are range ranks they are converted to a numeric vector (e.g.,
"S2S4"
becomes c(2,3,4)
)
1 2 3 4 5 6 | ranks_to_numeric(
ranks,
simplify = FALSE,
round_fun = stats::median,
keep = "B"
)
|
ranks |
character vector of input S ranks |
simplify |
converts list to numeric vector, and rounds range ranks
using the function supplied to |
round_fun |
what function to use (default |
keep |
which component to of a rank with multiple ranks for different
breeding statuses. |
a list the same length as ranks
of numeric vectors. For range
ranks, the vector will be sequence from low to high (e.g.,"S3S5"
becomes
c(3,4,5)
)
1 2 | ranks_to_numeric(c("S1", "SX", "S2S4", "SH", "S2?", "S3B,S2N"))
ranks_to_numeric(c("S1", "SX", "S2S4", "SH", "S2?", "S3B,S2N"), keep = "N")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.