daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tmp should be replaced with S above, also, an alternative solution below
  2.  
  3. ## data is in a file that looks like this
  4.   3266.46
  5.   1343.97  721.91
  6.   731.54  324.25  179.28
  7.   1175.5  537.35  281.17  474.98
  8.   162.68  80.17  39.15  63.73  9.95
  9.   238.37  117.73  56.8  94.85  13.88  21.2
  10.  
  11. ## R code
  12. data <- scan("./P8-23.dat")
  13. S <- matrix(0,6,6)
  14. S[upper.tri(S,diag=TRUE)] <- data
  15. S <- S + t(S)
  16. diag(S) <- diag(S) - 0.5*diag(S)
RAW Paste Data
Top