data.frame.$columnToAdd["CurrentColumnName" == "ConditionMet"] <- 1 Can someone please explain to me why the above command gives all NAs to columnToAdd? I thought this was possible in R to do logical expression in the index of a data frame [[alternative HTML version deleted]]