title: How to implement mutation function of genetic algorithm in R?
body: <p>I'm implementing GA algorithm. The chromosomes have a combination of <strong>-1,0,1</strong> values. In the mutation part, I want to change -1 to 1 with <strong>prob(-1 to 1)</strong> and change 1 to -1 with <strong>prob(1 to -1)</strong>.
  I don't know if there is any function in R which would make it easy for me. Would any one tell me if there is a function which helps me replace the values according to their probability?</p>