Description Usage Arguments Value Author(s) Examples
View source: R/getNewGapsInd.R
This function creates nGaps gaps of length lGaps in the time series timSer. It is used internally. The gaps do not overlay amongst them; they do not overlay pre-existing gaps either.
1 | getNewGapsInd(timSer, lGaps, nGaps)
|
timSer |
The time series where the gaps will be created. |
lGaps |
The length of the gaps |
nGaps |
The number of gaps. |
A vector containing the indices of the gaps
Marina Saez Andreu
1 2 3 4 5 6 7 8 9 10 11 12 | # Create time series
TS <- genTSExample(InKTSEnv = FALSE)[1:50,]
# Create 3 gaps of 7 NAs each
gInd <- getNewGapsInd(TS, 7, 3)
# Create time series duplicate and apply the gaps
TS1 <- TS
TS1$value[gInd] <- NA
#Compare
cbind(TS, TS1$value)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.