R: Coerce a tsibble to a time series

as.ts.tbl_ts {tsibble} | R Documentation

## Coerce a tsibble to a time series

### Description

Coerce a tsibble to a time series

### Usage

    ## S3 method for class 'tbl_ts'
    as.ts(x, value, frequency = NULL, fill = NA, ...)

### Arguments

`x` | A `tbl_ts` object.
`value` | A measured variable of interest to be spread over columns, if multiple measures.
`frequency` | A smart frequency with the default `NULL`. If set, the preferred frequency is passed to `ts()`.
`fill` | A value replaces missing values.
`...` | Ignored for the function.

### Value

A `ts` object.

### Examples

    # a monthly series ----
    x1 <- as_tsibble(AirPassengers)
    as.ts(x1)

    # equally spaced over trading days, not smart enough to guess frequency ----
    x2 <- as_tsibble(EuStockMarkets)
    head(as.ts(x2, frequency = 260))

[Package tsibble version 0.7.0 Index]