na.trim | R Documentation |
Internal soundgen function. Nearly 10 times faster than zoo::na.trim. Slightly slower solution: a[!cumprod(is.na(a)) & rev(!cumprod(is.na(rev(a))))]. See https://stackoverflow.com/questions/42759027/remove-leading-and-trailing-na
na.trim(x)
x |
numeric vector |
soundgen:::na.trim(c(NA, NA, 1:10, NA, 21:25, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.