R/expand.mat.R

# rows of matrix mat are expandend according to
# frequencies given in vector freq,
#    freq must have a length of nrow(mat)

expand.mat<-function(mat,freq)
{
    mat<-as.matrix(mat)
    mat[rep(seq_len(nrow(mat)), freq), ]
}

Try the prefmod package in your browser

Any scripts or data that you put into this service are public.

prefmod documentation built on May 2, 2019, 4:59 p.m.