R/main.R
vec2list.Rd
Transfer a vector to a list
vec2list(y_int, nvec)
a vector with length n.
an integer vector, specify the length of each component in the transferred list. n=sum(nvec).
n=sum(nvec)
return a list with each component vector
vec2list(c(rep(1,3), rep(2, 5)), nvec=c(3, 5)) #> [[1]] #> [1] 1 1 1 #> #> [[2]] #> [1] 2 2 2 2 2 #>