Displaying 1 result from an estimated 1 matches for "mutate2".
Did you mean:
  mutate
  
2012 Nov 16
1
Code works, but not as function.
...+1 # Increace counter number 2.
      if(runif(1) < 0.9) ifelse(runif(1) <0.5, Effectors[[l]][l2] <- Effectors[[l]][l2]+1, Effectors[[l]][l2] <- Effectors[[l]][l2]-1) # Line which increaces or decreaces the values in effvec, if the first IF statement is satisfied.
    }
  }
}
and:
Eff.Mutate2<-function(x){
  l<-0
  for(i in x){
    l2<-0
    l<-l+1
    for(i in x[[l]]){
      l2<-l2+1
      if(runif(1) < 0.9) ifelse(runif(1) <0.5, x[[l]][l2] <- x[[l]][l2]+1, x[[l]][l2] <- x[[l]][l2]-1)
    }
  }
}
However if I do either Eff.Mutate() or Eff.Mutate2(Effectors),...