tests/testthat/test_eq_clean_data.R

context("clean data")

# load data from package
df <- NOAAearthquakes
df_clean <- eq_clean_data()

test_that("Is eq_clean_data() function working properly ?", {

        expect_is(df_clean$date, "Date")
        expect_is(df_clean$LATITUDE, "numeric")
        expect_is(df_clean$LONGITUDE, "numeric")
        expect_is(df_clean$DEATHS, "integer")
        expect_is(df_clean$EQ_PRIMARY, "numeric")

})
Brunobt80/rPkgNOAADataset documentation built on May 20, 2019, 12:57 a.m.