Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. testList<-c(568120,711503,1077594)
  2. testResults<-(sapply(testList, function(x) participationCoefficient(x)))
  3.  
  4. > testResults
  5. [,1] [,2] [,3]
  6. [1,] 568120.0000000 711503.0000000 1077594.0000000
  7. [2,] 0.7333333 0.8780488 0.4166667
  8.  
  9. >authList<-moduleCalcs[[x]]$authId
  10. > authList[1:5]
  11. [1] 548114 553928 553929 556071 559044
  12.  
  13. > testResults<-(sapply(authList, function(y) participationCoefficient(y)))
  14.  
  15. Error in provideDimnames(x) :
  16. length of 'dimnames' [1] not equal to array extent
  17. Called from: top level
  18.  
  19. participationCoefficient<-function(auth){
  20. outmod<-as.data.frame(table(subset(m2$moduleId.x,(m2$A2==auth | m2$A1==auth) & m2$moduleId.y!=m2$moduleId.x)))
  21. deg<-nrow(subset(m2,m2$A1==auth | m2$A2==auth))
  22. partcoef<-1-(Reduce("+",(outmod$Freq/deg)))
  23. answer<-c(auth,partcoef)
  24. rm(deg,outmod,partcoef)
  25. return(answer)
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement