I am working with a dataset containing approximately 200 variables and almost all of them has a name like s_1_14, s_2_14, ... s_149_14, and obviously the variable names don't have the same length. I want to delete the "_14"-part of all the variable names, but I can't seem to figure out how to do it. I have tried the code from this post: Removing a suffix from a variable name , but since some of my variables are named s_144_14, it doesn't quite do the job. I really hope some of you how this is done other than renaming each variable manually 🙂
... View more