test_that("extract_datetime works as expected", {
x1 <- "myfile-2020-04-30-1230.csv"
y1 <- strptime('2020-04-30 12:30:00', format = "%Y-%m-%d %H:%M:%S", tz = "UTC")
expect_equal(extract_datetime(x1), y1)
x2 <- file.path("test", "2020-01-01", "myfile-2020-04-30-1230.csv")
y2 <- strptime('2020-04-30 12:30:00', format = "%Y-%m-%d %H:%M:%S", tz = "UTC")
expect_equal(extract_datetime(x2), y2)
x3 <- "COVID19_202007151345.xlsb"
y3 <- strptime('2020-07-15 13:45:00', format = "%Y-%m-%d %H:%M:%S", tz = "UTC")
expect_equal(extract_datetime(x3), y3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.