Skip to content

repeat rows of matrix by number (k) in one colummatrix adding column j with values 1:k

1 message · Jeff Newmiller

#
False premise: rep works fine

Mout2 <- cbind(M[ rep(seq.int(nrow(M)),M[,"k"]), c("x","y","z")],unlist(lapply(M[,"k"],seq.int)))
On March 31, 2020 6:18:37 PM PDT, nevil amos <nevil.amos at gmail.com> wrote: