Nothing
test_that("prepare_data filters and processes data correctly", {
# Ensure the required packages are loaded for the test
library(lubridate)
# Example input data
data <- data.frame(
Date = c("19990101", "19990115", "19990201", "19990301", "19990315", "19990401"),
Var1 = c(1, 2, -99.99, 4, 5, -99.99),
Var2 = c(3, -99.99, 6, 7, 8, 9),
Var3 = c(10, 11, 12, 13, -99.99, 15)
)
# Run the function with default date range
result <- prepare_data(data, date_column_index = 1, start_date = '19990101', end_date = '19990430')
# Check the structure of the result
expect_type(result, "list")
expect_true("x" %in% names(result))
expect_true("mon" %in% names(result))
expect_true("count" %in% names(result))
expect_true("Date" %in% names(result))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.