Change the value (time) in a dataset into text in R

12 Views Asked by At

I am working with this dataset:

TPdata:

id  Tp1 Sp2 time
A   1   7  08:00:00
B   2   8  09:00:00
C   3   9  18:30:00
D   4  10  20:00:00
E   5  11  08:00:00
F   6  12  09:00:00

I would like to change the entries 08:00:00 in column time to 'early'. I thought this would work but it isn't:

TPdata$time[TPdata$time == 18:30:00] <- "early"

Can anyone help?

0

There are 0 best solutions below