complete.ts: Creates additional dates and values when NA where removed and...

Description Usage Arguments Value Examples

View source: R/prepare_ts.R

Description

Creates additional dates and values when NA where removed and the TS is not complete

Usage

1
complete.ts(dates, values, freq, complete = 0)

Arguments

dates

A vector of dates that can be parsed by lubridate

values

A vector of same size as dates

freq

A chacracter string that indicates the frequency of the time series ("week", "month", "quarter", "day").

complete

A numerical value (or NA) to fill the missing data points

Value

A dataframe with 2 columns : date and val, with additional rows

Examples

1
2
3
4
5
library(lubridate)
library(dplyr)
dates <- seq(as_date("2000-01-01"),as_date("2010-12-31"),"month")
values <- rnorm(length(dates))
complete.ts(dates,values,"month",complete = 0)

vivienroussez/autoTS documentation built on June 11, 2020, 8:45 p.m.