Learn R Programming

pdt (version 0.0.2)

do_remove_NA_series_above_k: 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)

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.

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

Examples

Run this code
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))

Run the code above in your browser using DataLab