View source: R/pitch_postprocessing.R
intplNA | R Documentation |
Internal soundgen function
intplNA(x, idx_na = NULL, nPoints = 1)
x |
numeric vector |
idx_na |
which(is.na(x)) |
nPoints |
the number of points to use for interpolating leading and trailing NAs: 1 = constant interpolation, 2 = use the first two non-NAs at the beginning and the last two non-NAs at the end, etc. |
Takes a numeric vector and fills in the NAs by linear interpolation in the middle and constant or linear interpolation at the ends.
Returns the same numeric vector with NAs filled in by interpolation.
soundgen:::intplNA(c(NA, 405, 441, 460, NA, NA, NA, 480, 490, NA, NA))
soundgen:::intplNA(c(NA, 405, 441, 460, NA, NA, NA, 480, 490, NA, NA), nPoints = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.