inst/unit_tests/test_validate_timeDF.R

test_validate_timeDF = function(){
    time_df = data.frame(
        time = c("2023-12-01 01:00:00",
                 "2023-12-01 02:00:00",
                 "2023-12-01 03:00:00",
                 "2023-12-02 04:00:00"),
        value = c(123,
                  144,
                  150,
                  100)
    )
    timeDF = timeDF::as.timeDF(time_df)

    RUnit::checkEquals(
               timeDF::validate_timeDF(
                   timeDF,
                   noerror=TRUE),
               TRUE)
    RUnit::checkEquals(
               timeDF::validate_timeDF(
                   data.frame(),
                   noerror=TRUE),
               FALSE)
}

Try the timeDF package in your browser

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

timeDF documentation built on May 29, 2024, 5:12 a.m.