Skip to contents

tk_summary_diagnostics() returns the time series summary from one or more timeseries groups in a tibble.

Usage

tk_summary_diagnostics(.data, .date_var)

Arguments

.data

A tibble or data.frame with a time-based column

.date_var

A column containing either date or date-time values. If missing, attempts to auto-detect the date or date-time column.

Value

A tibble or data.frame with timeseries summary features

Details

Applies tk_get_timeseries_summary() group-wise returning the summary of one or more time series groups.

  • Respects dplyr groups

  • Returns the time series summary from a time-based feature.

Examples

library(dplyr)
library(timetk)

# ---- NON-GROUPED EXAMPLES ----

# Monthly Data
m4_monthly %>%
    filter(id == "M750") %>%
    tk_summary_diagnostics()
#> tk_augment_timeseries_signature(): Using the following .date_var variable: date
#> # A tibble: 1 × 12
#>   n.obs start      end        units scale tzone diff.minimum diff.q1 diff.median
#>   <int> <date>     <date>     <chr> <chr> <chr>        <dbl>   <dbl>       <dbl>
#> 1   306 1990-01-01 2015-06-01 days  month UTC        2419200 2592000     2678400
#> # … with 3 more variables: diff.mean <dbl>, diff.q3 <dbl>, diff.maximum <dbl>

# ---- GROUPED EXAMPLES ----

# Monthly Data
m4_monthly %>%
    group_by(id) %>%
    tk_summary_diagnostics()
#> tk_augment_timeseries_signature(): Using the following .date_var variable: date
#> # A tibble: 4 × 13
#> # Groups:   id [4]
#>   id    n.obs start      end        units scale tzone diff.minimum diff.q1
#>   <fct> <int> <date>     <date>     <chr> <chr> <chr>        <dbl>   <dbl>
#> 1 M1      469 1976-06-01 2015-06-01 days  month UTC        2419200 2592000
#> 2 M2      469 1976-06-01 2015-06-01 days  month UTC        2419200 2592000
#> 3 M750    306 1990-01-01 2015-06-01 days  month UTC        2419200 2592000
#> 4 M1000   330 1988-01-01 2015-06-01 days  month UTC        2419200 2592000
#> # … with 4 more variables: diff.median <dbl>, diff.mean <dbl>, diff.q3 <dbl>,
#> #   diff.maximum <dbl>