Reputation: 11
searched a bit throughout the forum, sorry, beginner question ...
I have a list called Data, with two columns, named "dates" and "countries" I'd like to replace a specific value in the column country, here is what I try
Data[Data$countries == "GE",]<-"DE"
It computes, but when I display Data, I still find the GE value...
Upvotes: 1
Views: 45
Reputation: 887118
We need to assign it to the column (assuming that the column is character
class) instead of the whole dataset
Data$countries[Data$countries == "GE"] <- "DE"
Upvotes: 1