sub-.ts_data: Subset Extraction for Time Series Data

[.ts_dataR Documentation

Subset Extraction for Time Series Data

Description

Extracts a subset of a time series object based on specified rows and columns. The function allows for flexible indexing and subsetting of time series data.

Usage

## S3 method for class 'ts_data'
x[i, j, ...]

Arguments

x

ts_data object

i

row i

j

column j

...

optional arguments

Value

returns a new ts_data object

Examples

data(sin_data)
data10 <- ts_data(sin_data$y, 10)
ts_head(data10)
#single line
data10[12,]

#range of lines
data10[12:13,]

#single column
data10[,1]

#range of columns
data10[,1:2]

#range of rows and columns
data10[12:13,1:2]

#single line and a range of columns
#'data10[12,1:2]

#range of lines and a single column
data10[12:13,1]

#single observation
data10[12,1]

daltoolbox documentation built on Nov. 3, 2024, 9:06 a.m.