TimeSeries: Convert char dates in Dates keeping data

Description Usage Arguments Value Examples

Description

Convert a data.frame with dates and numeric values into a new one including year, month, day, minute and second generated trough the dateformat applied to the original dates.

Usage

1
TimeSeries(dates, dateformat, data = NULL, tz = "GMT")

Arguments

dates

char vector of dates same length of data

dateformat

date format. See strptime for more information and examples

data

data numeric vector, matrix or data.frame containing time series data

tz

time zone. It gets the system date

Value

data.frame with split dates and values

Examples

1
2
3
4
dates <- as.character(as.POSIXct(as.Date(time(AirPassengers))+1))
value <- as.numeric(AirPassengers)
dateformat <- "%Y-%m-%d"
y <- TimeSeries(dates, dateformat, value)

evandeilton/cvforecast documentation built on May 16, 2019, 9:36 a.m.