[.ts_data | R Documentation |
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.
## S3 method for class 'ts_data'
x[i, j, ...]
x |
|
i |
row i |
j |
column j |
... |
optional arguments |
returns a new ts_data object
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]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.