Learn R Programming

mtconnectR (version 1.2.1)

convert_interval_to_ts: Convert Interval to Time Series

Description

Basically reverse the effect of convert_ts_to_interval. Column names should be same as mentioned in the example

Usage

convert_interval_to_ts(df, time_colname = "start", end_colname = "end",
  remove_last = F)

Arguments

df

Data.frame in start, end, duration, value1, value2,...

time_colname

Name of the time column

end_colname

Name of the end time column

remove_last

Logical value to remove the last row in the result

See Also

convert_ts_to_interval

Examples

Run this code
# NOT RUN {
test_interval =
  data.frame(start = as.POSIXct(c(0.5, 1, 1.008, 1.011),  tz = 'CST6CDT', origin = "1970-01-01"),
             end   = as.POSIXct(c(1, 1.008, 1.011, 2),  tz = 'CST6CDT', origin = "1970-01-01"),
             duration = c(0.50, 0.01, 0.00, 0.99),
             y     = c("e", "e", "e", "f"))
convert_interval_to_ts(test_interval)
# }

Run the code above in your browser using DataLab