# NOT RUN {
x <- c(1, 1 , 2, 3, 4, 4, 1, 1, 3, 3, NA, 5)
fv_runs(x)
fv_runs(x, fill = '-')
fv_runs(x, fill = '-', missing = 'X')
# }
# NOT RUN {
library(dplyr)
set.seed(10)
data.frame(
state = sort(sample(state.name[c(1, 5, 9, 12)], 12, TRUE)),
val = rnorm(12)
) %>%
mutate(state2 = fv_runs(state))
# }
Run the code above in your browser using DataLab