I have one column "x" that has a bunch of terms. The terms are all different (EX. 123_pro, 125_pro, 948_pro), however, they all have the same "_pro" suffix. How can I get rid of the "_pro" suffix from all the terms that exist within this single column so that it just become 123, 125, 948, etc. I've included a dput.
Hello! This shows the new names without "_pro" in the console (as shown in your comment at the bottom), but when I look back at the actual dataframe, it looks like the terms still have the "_pro" after them and were not changed
If you would like to understand working with data (the tidy way, as this forum promotes)
You could study the book https://r4ds.had.co.nz/
Particularly chapter 5
Hello. I've tried doing this: Unfortunately, it only seems to show up in the console, but not in the actual dataframe, which still has the _pro ending. I've your suggestion as well, but that did not seem to work either. Thank you for your help!
I've done this, and inserted a new name (df_new), yet my_df still has the _pro endings, despite the console showing the new, correct terms without the _pro in them.
Most R functions do not perform in-place modifications, they return a new object instead, so, if you want to overwrite the original dataframe to include the changes, you have to do it explicitly.