Learn R Programming

FlowScreen (version 2.0)

missingness: missingness test

Description

Determine the annual amount of missing data and generate an optional missingness plot.

Usage

missingness(
  TS,
  title = FALSE,
  plot = TRUE,
  increasing = TRUE,
  cols = c("white", "blue"),
  omar = c(2, 2, 2, 2),
  mar = c(3, 5, 3, 2)
)

Value

A list containing:

  • years_total: Number of years from start to ending year.

  • years_with_obs: Number of years with observations.

  • years_no_missing_obs: Number of years with no missing days.

  • complete_years: Individual years with no missing data.

  • partial_years: Individual years with some observations.

  • longest_common_period_years: Number of sequential years with complete data.

  • lcperiod_st: Starting year of the sequence of years with complete data.

  • lcperiod_nd: Ending year of the sequence of years with complete data.

  • table: A dataframe with years, and counts and fractions of missing data.

  • missingness plot: A plot showing the missingness data (if plot = TRUE).

Arguments

TS

A data frame of streamflow time series loaded with read.flows.

title

optional plot title. Default is FALSE indicating no plot title is wanted. Set to TRUE to use the the default plot title, which will look for 'plot title' attribute of the data.frame set by set.plot.titles. All values other values will be used as a custom plot title.

plot

Logical, default is TRUE. If FALSE, does not produce a plot.

increasing

Logical, default is TRUE. If FALSE, years are ordered from top to bottom.

cols

Plot colors, default is white and blue. White always corresponds to NA. Only observed color can be changed.

omar

Vector of length 4, outer margins for the plot.

mar

Vector of length 4, margins for the plot.

Author

Paul Whitfield

Details

Determine the Annual Amount of Missing Data and Generate a Missingness Plot

Examples

Run this code
robin_path <- system.file("extdata", "ROBIN_example.csv", package = "FlowScreen")

TS <- read.flows(robin_path)
res <- missingness(TS, cols = c("white", "red"), increasing = FALSE)

Run the code above in your browser using DataLab