do_remove_NA_series_above_k: do_remove_NA_series_above_k

View source: R/do_remove_NA_series_above_k.R

do_remove_NA_series_above_kR Documentation

do_remove_NA_series_above_k

Description

Remove series of more than k succeeding NA's in x, y, and x_values. This function is recommended before performing a permutation distancing test.

Usage

do_remove_NA_series_above_k(x, y, k, x_values = NULL)

Arguments

x

factor vector to indicate conditions or phases (e.g., "A" and "B")

y

numeric vector with the observed y-values

k

maximum allowed number of NA's

x_values

numerical vector with distance (time markers) between observations

Value

List with the modified x, y, x_values: x = factor vector with conditions (e.g., "A" and "B"). y = vector with observed values. x_values = vector with distance (time markers) between observations x,y.

Examples

pdt::do_remove_NA_series_above_k(as.factor(c("A","A","A","B","B","B")),
  c(1.1,NA,NA,7.1,8.3,9.8), 1, c(1,2,4,5,6,8))


pdt documentation built on Jan. 13, 2023, 1:13 a.m.