powered by
This function checks if all years specified in a given time series are present.
check_timeseries(timeseries, yro)
A logical value indicating whether all years in the time series are present.
A time series object.
A vector specifying the start and end years.
ts_data <- seq(as.POSIXct("2000-01-01"), as.POSIXct("2004-12-31"), by = "year") check_timeseries(ts_data, c(2000, 2004)) # Output: TRUE check_timeseries(ts_data, c(2000, 2005)) # Output: FALSE
Run the code above in your browser using DataLab