Dear all, I would like to replace some values in a dataframe (including the columns Action, Interval and Artificiality) depending on a combination of different conditions
the command I tried is for (j in 1:nrow(data)) { if ((data[j,data$Action]=="s") & (data[j,data$Interval]=="l") & (data[j,data $Artificiality]!="a")) {data[j,data$Artificiality]<-"na"} else { if ((data[j,data$Action]=="l") & (data[j,data$Interval]=="s") & (data[j,data $Artificiality]!="a")) {data[j,data$Artificiality]<-"na"} } } R does not give me an error message, but it is also not doing anything... can somebody be of help? Thanks Katrin [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.