R/cod.data.r

Defines functions cod.data

# function to isolate and/or group cod from the Mxc matrix
cod.data <- function(k, Mxc, exp){

  if(!(all(k < 0) | all(k > 0))){break ; warning("Cod must be all included or all excluded")}

  if(length(k) == 1){if(k > 0){m <- Mxc[,k]}else{m <- rowSums(Mxc[,k])}}else{
    m <- rowSums(Mxc[,k])}

  if(!is.null(dim(m))){warning("Error")}

  d <- m * exp

  return(data.frame(m,d,exp))
}

Try the MortHump package in your browser

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

MortHump documentation built on Jan. 24, 2018, 6:02 p.m.