Learn R Programming

SciencesPo (version 1.02.12)

as.timedf: A data.frame with time series parameters

Description

Return a data.frame with time parameters and time variable

Usage

as.timedf(timevar, format, x = NULL, tz = "GMT")

Arguments

timevar
the time variable
format
the time format
x
the data variable to be converted to a time series
tz
Time zone code, default is GMT

encoding

UTF-8

Details

A data frame containing time variable parameters and measuring variable

See Also

tsCollapse

Examples

Run this code
data(ssex)
myts <- as.timedf(timevar = ssex$Date, format = "%Y", x= ssex$Favor)
peek(myts)

data(us2012)
Obama.ts <- as.timedf(us2012[,3], "%Y-%m-%d", us2012[,8])
peek(Obama.ts)

Run the code above in your browser using DataLab