# You can use which() to find rows with the typo "nnchilled" which(CO2$Treatment=="nnchilled") # Row number ten # You can then correct the error using indexing: CO2$Treatment[10] <- "nonchilled" # Alternatively, doing it with a single command: CO2$Treatment[which(CO2$Treatment=="nnchilled")] <- "nonchilled" # Now doing the same for "chiled": CO2$Treatment[which(CO2$Treatment=="chiled")] <- "chilled"