I have a dataset from 1966 to 2002, I want change the units(multiply values by 0.305) of some of the values in the dataframe from 1966/05/07 to 1973/01/27 and want the rest of the values to remain as they are.
Sample Data Date A01
1 1966/05/07 4.870000
2 1966/05/08 4.918333
3 1966/05/09 4.892000
4 1966/05/10 4.858917
5 1966/05/11 4.842000
6 1967/03/18 4.89517
7 1966/05/07 4.870000
8 1966/05/08 4.918333
9 1966/05/09 4.892000
10 2000/05/10 2.858917
11 2001/05/11 1.842000
12 2002/03/18 0.89517
Desired Outcome Date A01
1 1966/05/07 1.4843
2 1966/05/08 1.4990
3 1966/05/09 1.49108 4 1966/05/10 1.480992
5 1966/05/11 1.48565 6 1967/03/18 1.4920
7 1966/05/07 1.4843
8 1966/05/08 1.4991
9 1966/05/09 1.4910
10 2000/05/10 2.858917
11 2001/05/11 1.842000
12 2002/03/18 0.89517
I tried this --->>>
Comb_A01 <- Comb_A01 %>% mutate(A01 = ifelse(Date>= as.Date("1966/05/07", format="%Y/%m/%d") & Date <= as.Date("1973/01/27", format="%Y/%m/%d"), A01 * 0.305, A02))
but it stops multiplying at 1970/10/17