You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
166 B

3 years ago
  1. sum1 <-
  2. function(m) {
  3. res = 0
  4. for(i in 1:dim(m)[1]) {
  5. for(j in 1:dim(m)[2]) {
  6. res <- res + m[i,j]
  7. }
  8. }
  9. return(res)
  10. }