8000 Some notes on missings in a time series run to clean up · Issue #91 · njtierney/naniar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Some notes on missings in a time series run to clean up #91
Open
@njtierney

Description

@njtierney

Need to make miss_var_run and miss_var_span work for:

  • multiple time series (mts), a facet for each variable.
  • regular data.frames that contain time series / time like data.

These would detect a date/time object, perform something special. The user could also provide the date/time variable of interest.

Some example mts objects include fpp2::arrivals

We could also consider the following additional arguments/features:

  • n_period (how many periods in your time series do you want?)
  • size_period (how long are the periods in your time series.)

This could also be a vector:

  • size_period = c(3,10,100) OR
  • size_period = c(100) OR
  • size_period = c(100,50)

Regarding the use of miss_var_run, it might also be useful to summarise the frequency of the size of the runs.

So, ideally, I want variables like:

|| run_size | n_missing | n_complete | prop_missing | prop_complete ||

Possible implementation for multiple spans

pedestrian %>%
  mutate(weekday = if_else(Day == "Saturday" | Day == "Sunday",
                            true = "weekend",
                            false = "weekday")) %>%
   group_by(Sensor_Name,
            weekday) %>%
  miss_ts_summary(time_index = Date_Time,
                 variable = Hourly_Counts
 naniar:::add_period_counter(period_length = ) %>%
 dplyr::group_by(period_counter) %>%
 dplyr::tally(is.na(Hourly_Counts))
 dplyr::rename(n_miss = n) %>%
 dplyr::mutate(n_complete = length(dat_ts) - n_miss,
                 prop_miss = n_miss / period,
                 prop_complete = 1 - prop_miss)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0