tsl_diagnose {distantia}R Documentation

Diagnose Issues in Time Series Lists

Description

A Time Series List (tsl for short) is a named list of zoo time series. This type of object, not defined as a class, is used throughout the distantia package to contain time series data ready for processing and analysis.

The structure and values of a tsl must fulfill several general conditions:

Structure:

Values (optional, when full = TRUE):

This function analyzes a tsl without modifying it to returns messages describing what conditions are not met, and provides hints on how to fix most issues.

Usage

tsl_diagnose(tsl = NULL, full = TRUE)

Arguments

tsl

(required, list of zoo time series) Time series list to diagnose. Default: NULL

full

(optional, logical) If TRUE, a full diagnostic is triggered. Otherwise, only the data structure is tested. Default: TRUE

Value

invisible

See Also

Other tsl_management: tsl_burst(), tsl_colnames_clean(), tsl_colnames_get(), tsl_colnames_prefix(), tsl_colnames_set(), tsl_colnames_suffix(), tsl_count_NA(), tsl_handle_NA(), tsl_join(), tsl_names_clean(), tsl_names_get(), tsl_names_set(), tsl_names_test(), tsl_ncol(), tsl_nrow(), tsl_repair(), tsl_subset(), tsl_time(), tsl_to_df()

Examples

#creating three zoo time series

#one with NA values
x <- zoo_simulate(
  name = "x",
  cols = 1,
  na_fraction = 0.1
  )

#with different number of columns
#wit repeated name
y <- zoo_simulate(
  name = "x",
  cols = 2
  )

#with different time class
z <- zoo_simulate(
  name = "z",
  cols = 1,
  time_range = c(1, 100)
  )

#adding a few structural issues

#changing the column name of x
colnames(x) <- c("b")

#converting z to vector
z <- zoo::zoo(
  x = runif(nrow(z)),
  order.by = zoo::index(z)
)

#storing zoo objects in a list
#with mismatched names
tsl <- list(
  a = x,
  b = y,
  c = z
)

#running full diagnose
tsl_diagnose(
  tsl = tsl,
  full = TRUE
  )

[Package distantia version 2.0.0 Index]