I'm having some problems with if function in R.
First I tried this:
test<-matrix(10,3,3)
if(test[2,2]==10) {test[2,2]<-5}
Ok, it's doing what I want. So, I will try this:
if(Hylo.Measures[i,3]=="CLc0006x") {Hylo.Measures[i,3]<-"CLc0005x"}
Ops! I got the following message:
Warning message:
In `[<-.factor`(`*tmp*`, iseq, value = "CLc0005x") :
invalid factor level, NA generated
I couldn't figure out what is going on here!
What obvious step am I missing?