I have a string variable for time that has the timestamp. For example, one entry would look like: "4/25/2022 17:26". I have over 1,000 observations ranging from over 2 years ago to now. I want to create one category per month since the start of my data (25 categories). I need to categorize the dates (like time period A, time period B., time period C..) so I thought I would first make the string variable a continuous/ numeric variable so that I can do an if...then statement, creating a new, categorical variable, where I can efficiently say if a date is within a certain range it would go to the new categorical variable for the time period.
I have used the clock() function but don't know how to categorize it after that.
I was also trying to use the "strpos" function but was not successful.
I also know I might be planning this all wrong, any suggestions?
I have used the clock() function but don't know how to categorize it after that.
I was also trying to use the "strpos" function but was not successful.
I also know I might be planning this all wrong, any suggestions?
Comment