Skip to contents

Get and modify the Time Scale Template

Usage

set_tk_time_scale_template(.data)

get_tk_time_scale_template()

tk_time_scale_template()

Arguments

.data

A tibble with a "time_scale", "frequency", and "trend" columns.

Value

  • get_tk_time_scale_template(): Returns tibble containing the time scale template information.

  • set_tk_time_scale_template(): Returns nothing.

Details

Used to get and set the time scale template, which is used by tk_get_frequency() and tk_get_trend() when period = "auto".

The predefined template is stored in a function tk_time_scale_template(). This is the default used by timetk.

Changing the Default Template

  • You can access the current template with get_tk_time_scale_template().

  • You can modify the current template with set_tk_time_scale_template().

See also

Examples


get_tk_time_scale_template()
#> # A tibble: 8 × 3
#>   time_scale frequency trend   
#>   <chr>      <chr>     <chr>   
#> 1 second     1 hour    12 hours
#> 2 minute     1 day     14 days 
#> 3 hour       1 day     1 month 
#> 4 day        1 week    3 months
#> 5 week       1 quarter 1 year  
#> 6 month      1 year    5 years 
#> 7 quarter    1 year    10 years
#> 8 year       5 years   30 years

set_tk_time_scale_template(tk_time_scale_template())