R/coeflin.R

coeflin <-
function(mat, lmat){
	matcoeflin <- do.call("cbind",lapply(1:nrow(mat), function(x){
		nomsvars <- colnames(mat)[which(mat[x,]==1)]
		prod <- apply(lmat[,nomsvars, drop=FALSE], 1, prod)
		return(prod)
	}))
	colnames(matcoeflin) <- rownames(mat)
	return(matcoeflin)
}

Try the CMRCT package in your browser

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

CMRCT documentation built on May 2, 2019, 6:44 p.m.