tests/testthat/test-destination.R

test_that("vector of destination codes", {
    expect_equal(countrycode("Serbia", "country.name", "iso3c"), "SRB")
    expect_warning(expect_equal(countrycode("Serbia", "country.name", "cowc"), NA_character_))
    expect_warning(expect_equal(countrycode("Serbia", "country.name", c("cowc", "iso3c")), "SRB"))
})

Try the countrycode package in your browser

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

countrycode documentation built on May 29, 2024, 4:44 a.m.