I have a list of variables showing the income status of an individual in a given month in a given year. The variable format is 'income_'yyyy'_'mm'' where 'yyyy' refers to the year and 'mm' refers to the month. For example, the income status for october 2021 is shown as 'income_2021_10' and the income status for august 2021 is shown as 'income_2021_08'.
For purposes to fit my other code, I need the variables to exclude the first zero in the month, for the months january till september. That is, the month should go '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12' insted of going '01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12', so for example income status for august 2021 would be shown as 'income_2021_8'.
Any suggestions to rename the variables in an efficient manner?
For purposes to fit my other code, I need the variables to exclude the first zero in the month, for the months january till september. That is, the month should go '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12' insted of going '01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12', so for example income status for august 2021 would be shown as 'income_2021_8'.
Any suggestions to rename the variables in an efficient manner?
Comment