View source: R/maxLagMissVal.R
maxLagMissVal | R Documentation |
This function computes the maximum amount of consecutive missing values in a vector. This quantity is also known as maximum lag, run, or record, and can be used as a rough estimate of the quality of a dataset.
maxLagMissVal(x, type = c("NA", "numeric"), value)
x |
numeric vector. |
type |
character specifying the type of missing value to consider. Default is
|
value |
numeric giving a figure to be used to fill missing values; often as part of a pre-processing, missing values in a dataset (vector, time series, etc.) are fill in with pre-established values. |
A list containing:
maxLag |
numeric giving the maximum lag of missing values in |
x |
numeric vector with the original data |
value |
a numeric when |
rle
v <- c(NA, 0.12, 0.58, 0.75, NA, NA, NA, 0.46, 0.97, 0.39, NA, 0.13, 0.46, 0.95, 0.30, 0.98, 0.23, 0.98, 0.68, NA, NA, NA, NA, NA, 0.11, 0.10, 0.79, 0.46, 0.27, 0.44, 0.93, 0.20, 0.44, 0.66, 0.11, 0.88) maxLagMissVal(x=v, type="NA") w <- c(23,3,14,3,8,3,3,3,3,3,3,3,10,14,15,3,10,3,3,6) maxLagMissVal(x = w, type = "numeric", value = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.