R/expand.mat.R

Defines functions expand.mat

Documented in expand.mat

# 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 Sept. 30, 2023, 5:06 p.m.