areTsGapTimeCompatible: areTsGapTimeCompatible: tests time compatibility between a...

Description Usage Arguments Value Author(s) Examples

View source: R/areTsGapTimeCompatible.R

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

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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

KarsTS documentation built on Jan. 16, 2021, 5:07 p.m.