Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testList<-c(568120,711503,1077594)
- testResults<-(sapply(testList, function(x) participationCoefficient(x)))
- > testResults
- [,1] [,2] [,3]
- [1,] 568120.0000000 711503.0000000 1077594.0000000
- [2,] 0.7333333 0.8780488 0.4166667
- >authList<-moduleCalcs[[x]]$authId
- > authList[1:5]
- [1] 548114 553928 553929 556071 559044
- > testResults<-(sapply(authList, function(y) participationCoefficient(y)))
- Error in provideDimnames(x) :
- length of 'dimnames' [1] not equal to array extent
- Called from: top level
- participationCoefficient<-function(auth){
- outmod<-as.data.frame(table(subset(m2$moduleId.x,(m2$A2==auth | m2$A1==auth) & m2$moduleId.y!=m2$moduleId.x)))
- deg<-nrow(subset(m2,m2$A1==auth | m2$A2==auth))
- partcoef<-1-(Reduce("+",(outmod$Freq/deg)))
- answer<-c(auth,partcoef)
- rm(deg,outmod,partcoef)
- return(answer)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement