Learn R Programming

RtsEva (version 1.1.0)

check_timeseries: Check if all years in a time series are present

Description

This function checks if all years specified in a given time series are present.

Usage

check_timeseries(timeseries, yro)

Value

A logical value indicating whether all years in the time series are present.

Arguments

timeseries

A time series object.

yro

A vector specifying the start and end years.

Examples

Run this code
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