check_completeness {FlowScreen} | R Documentation |
Check Completeness
Description
Determine if the desired completeness criteria are being met. This considers if the date range of interest is complete, and whether internal gaps are longer than the criteria. There is an option for allowing the data set to be padded with an optional number of years and then tested using the same criteria. Function returns TRUE if the criteria are met and FALSE if not, and a numeric code that indicates the mode of failure or success.
Usage
check_completeness(
data,
st_yr,
nd_yr,
allowed = 3,
period = 10,
pad = NULL,
my = NULL
)
Arguments
data |
Result from |
st_yr |
Starting year of the desired period. |
nd_yr |
Ending year of the desired period. |
allowed |
Maximum number of years allowed to be missing in the period. |
period |
Period of years that cannot exceed an allowed gap. |
pad |
Optional number of years to pad the data set. |
my |
Optional maximum number of years allowed to be missing with padding. |
Value
A list containing:
TRUE or FALSE indicating conditions were met or not
code: 0 "met", 1 "not long enough period", 2 "gaps longer than allowed", and 3 "more gaps in period than allowed", 10 "met with pad", 11 "not long enough period with pad", 12 "gaps longer than allowed with pad", and 13 "more gaps in period than allowed with pad"
Messages indicating the reason for failure
Author(s)
Paul Whitfield
Examples
robin_path <- system.file("extdata", "ROBIN_example.csv", package = "FlowScreen")
TS <- read.flows(robin_path)
res <- missingness(TS, title = TRUE)
check_completeness(res, st_yr = 1985, nd_yr = 2014, allowed = 3, period = 10)