mists-plot: Range plot and spinoplot for runs of missings

Description Usage Arguments Spinoplot Examples

Description

na_rle_spineplot() is an alias of na_rle_spinoplot().

Usage

1
2
3
4
5
6
na_rle_rangeplot(data, x, y = NULL, ...)

na_rle_spinoplot(data, x, y = NULL, facets = NULL, ...)

## S3 method for class 'rle_na'
autoplot(object, y = as.factor(1L), ...)

Arguments

data

A data frame that contains list_of_na_rle().

x, y

A bare variable contains list_of_na_rle() mapped to x and y.

...
  • na_rle_rangeplot(): passed to ggplot2::geom_segment() & ggplot2::geom_point().

  • na_rle_spinoplot(): passed to ggplot2::facet_wrap().

facets

A facetting variable.

object

an object, whose class will determine the behaviour of autoplot

Spinoplot

x: lengths of runs of missings. width: the number of missing observations in the run. y: Either 1 or the fraction of intersections with other variables.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (!requireNamespace("nycflights13", quietly = TRUE)) {
  stop("Please install the nycflights13 package to run these following examples.")
}
library(dplyr, warn.conflicts = FALSE)
na_runs_wind <- nycflights13::weather %>% 
  group_by(origin) %>% 
  summarise_at(vars(contains("wind")), ~ list_of_na_rle(., time_hour))

na_runs_wind %>% 
  na_rle_rangeplot(wind_dir, origin)
na_runs_wind %>%
  na_rle_spinoplot(x = wind_dir, facets = origin)
na_runs_wind %>%
  na_rle_spinoplot(x = wind_dir, y = wind_gust, facets = origin)

earowang/mists documentation built on Sept. 21, 2019, 1:12 p.m.