If you have a condition using which specific values need to be changed then add the condition using which() to fetch the required values from the vector and then change.
For example,
dataframe$vector[which(condition) ] = "New Value"
Suppose you need to fetch the first 2 characters of the names from a vector which are from africa continentconti Then you can use r code as
countries$names[which(continent == "Africa")] = substr(countries$names,1,3)