tests/testthat/test-bruzek02.R

library(PELVIS)

test_that("bruzek02 gives correct answers", {
    x <- c("F", "0", "F", "0", "M")
    y <- c("F", NA, NA, NA, NA)
    z <- c("M", "M", "F", "F", "0")
    a <- c("M", "M", "M", NA, NA)
    expect_equal(bruzek02(x), "F")
    expect_equal(bruzek02(y), "F")
    expect_equal(bruzek02(z), "I")
    expect_equal(bruzek02(a), "M")
})

Try the PELVIS package in your browser

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

PELVIS documentation built on Aug. 8, 2023, 5:09 p.m.