R/conditdat.R

Defines functions conditdat

Documented in conditdat

## last modified June 2002

conditdat <- function(mixdat, k, conditsamples) 
{
    xname <- dimnames(mixdat)[[2]][1:2]
    cdt <- matrix(0, nrow = nrow(mixdat), ncol = k)
    rowmat <- matrix(conditsamples, ncol = (k + 1), byrow = TRUE)
    cdt[as.vector(rowmat[, 1]), ] <- rowmat[, -1]
    dat <- as.data.frame(cbind(mixdat[, 1:2], cdt))
    if (is.null(xname)) 
        xname <- c("X", "count")
    dimnames(dat)[[2]] <- c(xname, paste("C", 1:k, sep = ""))
    dat
}

Try the mixdist package in your browser

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

mixdist documentation built on May 2, 2019, 3:34 p.m.