as_ts: Convert ts_data Object to Time Series

as_tsR Documentation

Convert ts_data Object to Time Series

Description

Transforms a ts_data object into a standard R ts (time series) object.

Usage

as_ts(ts)

Arguments

ts

A ts_data object containing the time series values and structure.

Details

The function preserves the original time indices and frequency of the input ts_data. It calculates the deltat based on the time vector t in ts_data.

Value

A ts object representing the same time series as the input ts_data.

Examples

# Create a ts_data object with a linear trend
ts_obj <- ts_data(12, trend.coeff = c(sample(0:10, 1), sample(1 + (1:10)/20, 1)))

# Convert to standard ts object
ts_standard <- as_ts(ts_obj)

exams.forge documentation built on Aug. 21, 2025, 5:41 p.m.