Function to create a TSAgg formatted object.

Description

This function is required to organise the data into the required structure for all functions of the package TSAgg.

Usage

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

Arguments

dates

A vector, or data.frame of one column of dates.

dateformat

A string indicating the format of the dates (e.g. "

data

A vector or data.frame of data. Must be the same length as dates column.

tz

A character string specifying the time zone to be used. If not specified the system tz may be used. This is different on each OS, therefore it is recommended that this is supplied. Default is GMT.

Value

Returns a data.frame with dates formatted as as.POSIXlt and data, if provided.

Author(s)

Jason Lessels <jason.lessels@sydney.edu.au>

See Also

strptime

Examples

1
2
3
4
5
6
7
8
9
#Load the dataset foo:
data(foo)
#Look at the dataset foo for the date string format:
head(foo)
foo.ts <- timeSeries(foo[,1],"%d/%m/%Y   %H:%M",foo[,3])
#Try entering data manually into the function:
one.date <- timeSeries("08-09-30","%y-%m-%d",4)
#Look at the results:
one.date