R/linknum.R

Defines functions linknum

linknum <-
function(ags,fgs,network){

nags<-length(ags)
nfgs<-length(fgs)
nlink<-rep(0,nfgs)
names(nlink)<-names(fgs)

for (i in 1:nfgs){
    agsfgs<-as.vector(outer(ags,fgs[[i]],paste))
    fgsags<-as.vector(outer(fgs[[i]],ags,paste)) 
    ugs<-c(agsfgs,fgsags) ### we do not need to use "unique" function
    nlink[i]<-sum(ugs %in% network)
}
return(nlink)
}

Try the neaGUI package in your browser

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

neaGUI documentation built on May 2, 2019, 5:41 p.m.