Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tk_summary_diagnostics() function only displays differences in seconds #135

Open
StatsMan04 opened this issue Nov 18, 2022 · 0 comments
Open

Comments

@StatsMan04
Copy link

StatsMan04 commented Nov 18, 2022

The tk_summary_diagnostics() function is meant to provide us insight into our time series. Part of its usefulness come from being able to pinpoint irregular time series by looking at the mean/median difference between time stamps to check for gaps. The diff columns in this function display the distribution between timestamps is in terms of seconds, and while this may not be a problem when dealing with many daily time series, it can become problematic to think of weeks, months, or years in terms of seconds when every diff column is displayed in scientific notation. I'd like to see this updated to be able to display the diff statistics in terms of days, weeks, months, or years respectively to help give users a better handle on whether any irregular time series or gaps exist in the data.

Example:

# from High-Performance Time Series section 1.3.1

mailchimp_users_tbl <- read_rds("00_data/mailchimp_users.rds")


optins_day_tbl <- mailchimp_users_tbl %>%
    summarize_by_time(
        .date_var = optin_time,
        .by = "day",
        optins = n() 
    )

optins_day_tbl %>% tk_summary_diagnostics(.date_var = optin_time)


# monthly data set given as an example in the tk_summary_diagnostics() documentation where differences are harder to interpret

m4_monthly %>%
    group_by(id) %>%
    tk_summary_diagnostics()

tk_diff1
tk_diff2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant