rm0 | R Documentation |
Transforms n
sets of m>n
zeros (alternated with sets of non zeros) into n
sets of n
zeros.
rm0(y)
y |
A vector or time series. |
Vector with n zeros.
library(voice)
(v0 <- c(1:20,rep(0,10)))
(r0 <- rm0(v0))
length(v0)
length(r0)
sum(v0 == 0)
(v1 <- c(rep(0,10),1:20))
(r1 <- rm0(v1))
length(r1)
(v2 <- rep(0,10))
(r2 <- rm0(v2))
length(r2)
(v3 <- c(0:10))
(r3 <- rm0(v3))
length(r3)
(v4 <- c(rep(0,10), 1:10, rep(0,5), 10:20, rep(0,10)))
(r4 <- rm0(v4))
length(r4)
sum(v4 == 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.