# split data up into "before" and "after"
mydata <- splitByDate(mydata,
dates = "1/04/2000",
labels = c("before", "after")
)
# split data into 3 partitions
mydata <- splitByDate(mydata,
dates = c("1/1/2000", "1/3/2003"),
labels = c("before", "during", "after")
)
# if you have modelled data - could split into modelled and measured by the
# break date
dummy <- data.frame(
date = Sys.Date() + (-5:5),
nox = 100 + seq(-50, 50, 10)
)
splitByDate(dummy,
dates = Sys.Date(),
labels = c("measured", "modelled"),
name = "data_type"
)
Run the code above in your browser using DataLab