Hi,

I am trying to debug the following code:

for (i in 1:10){
  t <- paste("d0$V",i,sep="")
  t <- ifelse(regexpr(d1[i,1],d0$X0)>0,1,0)
}

and I would like to see what code is actually processing R, how can I do
that?

More to the point, I am trying to update my variables d0$V1 to d0$V10
according to the presence or absence of some text (contained in the file
d1) within the d0$X0 variable.

The code seem to run ok, if I add print(table(t)) within the loop I can see
that the ifelse procedure is working and to some cases within the d0$V1 to
d0$V10 variable range a 1 is assigned. But when checking my d0$V1 to d0$V10
after the for loop they are all still equal to zero...

Thanks,

Luca

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to