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))
result <- prepare_data(data, date_column_index = 1, start_date = '19990101', end_date = '19990430')
print(result)
Run the code above in your browser using DataLab