miss_var_span: Summarise the number of missings for a given repeating span...

Description Usage Arguments Value See Also Examples

View source: R/miss-x-span.R

Description

To summarise the missing values in a time series object it can be useful to calculate the number of missing values in a given time period. miss_var_span takes a data.frame object, a variable, and a span_every argument and returns a dataframe containing the number of missing values within each span.

Usage

1
miss_var_span(data, var, span_every)

Arguments

data

data.frame

var

bare unquoted variable name of interest.

span_every

integer describing the length of the span to be explored

Value

dataframe with variables n_miss, n_complete, prop_miss, and prop_complete, which describe the number, or proportion of missing or complete values within that given time span.

See Also

miss_case_pct miss_case_prop miss_prop_summary() miss_case_summary miss_case_table miss_summary miss_var_pct miss_var_prop miss_var_run miss_var_summary miss_var_table

Examples

1
2
3
4
5
6
7
8
9
miss_var_span(data = pedestrian,
             var = hourly_counts,
             span_every = 168)

 library(dplyr)
 pedestrian %>%
   group_by(month) %>%
     miss_var_span(var = hourly_counts,
                   span_every = 168)

naniar documentation built on June 8, 2018, 9:04 a.m.