R/networkmat.R

Defines functions networkmat

Documented in networkmat

networkmat <-
function(ID, sources) {
  tot.inf <- length(ID)
  truemat <- matrix(0, tot.inf, tot.inf)
  for (j in 1:tot.inf) {
    if (sources[j]%in%ID) {
      truemat[which(ID==sources[j]),j] <- 1
    }
  }
  return(truemat)
}

Try the seedy package in your browser

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

seedy documentation built on May 29, 2017, 10:58 a.m.