Advertisement
TLHLHT

R_code1

Oct 8th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.41 KB | None | 0 0
  1. rows <- 30000
  2. columns <- 100
  3.  
  4. dataSet <- matrix(runif(rows*columns), ncol=columns)
  5. oldColumns=rep(T, ncol(dataSet))
  6. euclidianDistances  <- rep(0, nrow(dataSet))
  7.  
  8. for (i in 1:rows){ # memory usage goes up
  9.   TestPackage:::calculateEuclidianDistances(dataSet, oldColumns, euclidianDistances)
  10. }
  11.  
  12. for (cycle in 1:rows){ # no problems here
  13.   calculateEuclidianDistances(dataSet, oldColumns, euclidianDistances)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement