I have a large data set that collects multiple data points each day from people over multiple days. My R dataset has participants' responses and the timestamp for their response. I want to recode the timestamp to reflect which order prompt they responded to. So basically, I want to assign a value to the timestamp based on a range of time. So if on Monday, a response falls between 10:00 and 10:30, I want the value to be 1. If a response falls between 12:15 and 12:45, I want the value to be 2. If a response falls between 2:20 and 2:50, I want the value to be 3.
BUT I need that code to work only for Monday's data. For Tuesday's data, the timestamp ranges changes. For example, if a Tuesday response falls between 9:10 and 9:40, that value should be 1. And so on.
I can't for the life of me how to figure this out with an if else statement. When I write time into R, it thinks I'm writing a code for a series of values (10 through 30) rather than time (10:30).
Example of what I want: (see the new Prompt column)
So for 10/11/15 I want Prompt 1 to fall between 11:15:00 and 11:45:00, but for 11/11/15 I want Prompt 1 to be different--between 12:00:00 and 12:30:00