areTsGapTimeCompatible {KarsTS} | R Documentation |
areTsGapTimeCompatible: tests time compatibility between a time series and a gap set
Description
It checks for three types of compatibility: the initial dates are the same, the sampling period is the same and the length is the same. It is used internally to check whether the inputs chosen by the user are appropiated.
Usage
areTsGapTimeCompatible(TS1, GAP1)
Arguments
TS1 |
A time series |
GAP1 |
A gap set |
Value
A logical vector, which is c(TRUE, TRUE, TRUE) when all the time compatibilty conditions are met.
Author(s)
Marina Saez Andreu
Examples
## Generate a time series
TS <- genTSExample(InKTSEnv = FALSE)
## Generate a gap set consisiting of four gaps of 3 NAs each
GS <- genGapExample(TS, 3, 4, InKTSEnv = FALSE)
## They are obviously compatible since we use TS to create GS
timeComp <- areTsGapTimeCompatible (TS, GS)
timeComp
## We modifify the time of TS. The initial dates are not compatible anymore,
## although the sampling period and the length remain untouched.
TS$time <- TS$time + 1
timeComp <- areTsGapTimeCompatible (TS, GS)
timeComp
[Package KarsTS version 2.4.1 Index]