as_funtsibble: Coerce to a funtsibble object

Description Usage Arguments Details Value See Also Examples

View source: R/tsibble.R

Description

Coerce to a funtsibble object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
as_funtsibble(x, key = NULL, funkey, index, regular = TRUE,
  validate = TRUE, .drop = TRUE, ...)

## S3 method for class 'demogdata'
as_funtsibble(x, ..., validate = TRUE)

## S3 method for class 'fts'
as_funtsibble(x, ..., validate = TRUE)

## S3 method for class 'tbl_ts'
as_funtsibble(x, funkey, ..., validate = TRUE)

Arguments

x

Objects to be coerced to a funtsibble ('fun_tbl_ts').

key

Unquoted variable(s) that uniquely determine time indices. 'c()' for multiple variables. It works with tidy selector (e.g. [dplyr::starts_with()]).

funkey

A subset of keys that define the functions.

index

A bare (or unquoted) variable to specify the time index variable.

regular

Regular time interval ('TRUE') or irregular ('FALSE'). The interval is determined by the greatest common divisor of index column, if 'TRUE'.

validate

'TRUE' suggests to verify that each key or each combination of key variables leads to unique time indices (i.e. a valid tsibble). If you are sure that it's a valid input, specify 'FALSE' to skip the checks.

.drop

If 'TRUE', empty key groups are dropped.

...

Other arguments passed on to individual methods.

Details

A funtsibble is sorted by any non-functional keys first, then functional keys and index.

Value

A funtsibble object.

See Also

as_tsibble

Examples

1
2
3
4
# coerce demogdata object to funtsibble ----
as_funtsibble(demography::fr.mort)
# coerce fts object to funtsibble ----
as_funtsibble(rainbow::ElNino_ERSST_region_1and2)

robjhyndman/funtsibble documentation built on Nov. 5, 2019, 3:14 a.m.