No library function I know of but you can write your own:
split.vec <- function(vec, sep = 0) {
is.sep <- vec == sep
split(vec[!is.sep], cumsum(is.sep)[!is.sep])
}
split.vec(c(1,2,0,3,4), 0)
# $`0`
# [1] 1 2
#
# $`1`
# [1] 3 4
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…