interp_nan {tagtools}R Documentation

Remove NAs from sensor data and return indices of (rows of) filled values

Description

This is an internal function used by htrack

Usage

interp_nan(data)

Arguments

data

a data vector or matrix

Value

A list with entries data (the input data with NAs filled in) and k a logical vector indicating the position (if data was a vector) or rows (if data was a matrix) where NAs were filled in. Internal NAs are filled via linear interoplation, while leading and trailing ones are filled using the first following or last preceding good value.

Examples

A <- matrix(c(NA, NA, 3, 4, 5, 6, 7, 8, 9, 10, NA, NA, 13, 14, 15, 16, NA, NA), ncol = 2)
result <- interp_nan(A)


[Package tagtools version 0.1.0 Index]