Full_Name: Bill Dunlap
Version: 2.5.0
OS: Linux
Submission from: (NULL) (70.98.76.47)


sequence(nvec) is documented to return
the concatenation of seq(nvec[i]), for
i in seq(along=nvec).  This produces inconvenient
(for me) results for 0 inputs.
    > sequence(c(2,0,3)) # would like 1 2 1 2 3, ignore 0
    [1] 1 2 1 0 1 2 3
Would changing sequence(nvec) to use seq_len(nvec[i])
instead of the current 1:nvec[i] break much existing code?

On the other hand, almost no one seems to use sequence()
and it might make more sense to allow seq_len() and seq()
to accept a vector for length.out and they would return a
vector of length sum(length.out),
    c(seq_len(length.out[1]), seq_len(length.out[2]), ...)

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to