as.timeDF {timeDF}R Documentation

Function to construct timeDF object from dataframe

Description

as.timeDF function converts dataframe into timeDF class object

Usage

as.timeDF(df, time_var = "time", format = "%Y-%m-%d %H:%M:%S")

Arguments

df

dataframe that holds a column for time as character.

time_var

character element that specifies column name for time in the dataframe.

format

character element that specifies a format for times. If "as_is" is specified, column for start is used as it is without conversion. In this case, column needs to be POSIXlt with UTC timezone.

Details

as.timeDF function constructs timeDF object from dataframe.

Value

timeDF object

See Also

timeDF-class timeDF-package

Examples

time_df = data.frame(
    time = c("2023-12-01 01:00:00",
             "2023-12-01 02:00:00",
             "2023-12-01 03:00:00",
             "2023-12-01 04:00:00"),
    value = c(123,
              144,
              150,
              100)
)
as.timeDF(time_df)

[Package timeDF version 0.9.1 Index]