Find & Replace Function in .R

I wrote a find and replace function for my data set, I want to change a particular string in a column from every occurrence of X to Y. I wrote this function although it does not change the dataset it creates a group of values? How can I modify this to change the strings in that column

data <- gsub("X", "Y", data_frame$column)

Edit 1: Also tried this although did not fully understand.

I got the solution, was a very simple syntax error actually.

data_frame$column <- gsub("X", "Y", data_frame$column)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.