extract_grading: Extract the grading from a Burn Grading field value

View source: R/extract_grading.R

extract_gradingR Documentation

Extract the grading from a Burn Grading field value

Description

[Stable]

Usage

extract_grading(grading_string)

Arguments

grading_string

A string in the format ⁠<grading>_<label>⁠. These strings are field values of the form "Burn Grading". E.g. "0.5_test-label", "2.0_other-label".

Value

The grading as numeric value, e.g. 0.5, 2.0.

See Also

Other helpers: map_ozcbi_forest(), reactable_ozcbi_forest()

Examples

testthat::expect_equal(extract_grading("0.0_test"), 0.0)
testthat::expect_equal(extract_grading("0.5_test"), 0.5)
testthat::expect_equal(extract_grading("1.0_test"), 1.0)
testthat::expect_equal(extract_grading("1.5_test"), 1.5)
testthat::expect_equal(extract_grading("2.5_test-with-long-label"), 2.5)

dbca-wa/rGeoCBI documentation built on Aug. 25, 2023, 2:17 a.m.