tests/testthat/test-format_gwt.R

test_that("format_gwt works", {
  expect_equal(
    format_gwt(
      B_GWL_CLASS = c('sVb', 'sVa', 'sVII', 'sVI', 'sV', 'bVII', 'bVI', 'Vb', 'Va', 'VIII', 'VII', 'VI',
      'V', 'IVu', 'IV', 'IIb', 'IIIb', 'IIIa', 'III', 'II', 'I', '-')
    ),
    expected = c("GtV", "GtV", "GtVII", 'GtVI', 'GtV', 'GtVII', 'GtVI', 'GtV', 'GtV', 'GtVIII', 'GtVII', 'GtVI',
                 'GtV', 'GtIV', 'GtIV', 'GtII', 'GtIII', 'GtIII', 'GtIII', 'GtII', 'GtI', 'GtIII')
  )
  expect_equal(
    format_gwt(
      B_GWL_CLASS = c("GtIII", "GtVI", "GtIIb")
    ),
    expected = c("GtIII", "GtVI", "GtII")
  )
  expect_equal(
    format_gwt(
      B_GWL_CLASS = c("II", "VI", "IIb", "GtIII", "GtIIIb")
    ),
    expected = c("GtII", "GtVI", "GtII", "GtIII", "GtIII")
  )
})

Try the OBIC package in your browser

Any scripts or data that you put into this service are public.

OBIC documentation built on Sept. 12, 2024, 7:02 a.m.