I've imported a CSV file and I want to change the variable value for symbol column. If the value is "ABCD.BO" then "Stock_T". If the value is "XYZ.BO" then "Stock_Y". I tried to fix it but I am getting a warning message and I checked the dataframe contains "NA" after changing.
df$symbol[df$symbol == "ABCD.BO"] <- "Stock_T"
df$symbol[df$symbol == "XYZ.BO"] <- "Stock_Y"
Warning message:
In `[<-.factor`(`*tmp*`, df$symbol == "ABCD.BO", :
invalid factor level, NA generated