I have data in the zoo format in the following structure
date val
2020-11-01 3244
2020-11-02 3273
2020-11-03 2974
2020-11-04 3283
2020-11-05 3922
2020-11-06 3669
2020-11-07 4246
2020-11-08 4594
2020-11-09 4086
2020-11-10 4302
2020-11-11 4559
2020-11-12 4981
2020-11-13 4741
2020-11-14 5267
that I am trying to get into this form
date val
Mon 2020-11-01 3244
Tue 2020-11-02 3273
Wed 2020-11-03 2974
Thu 2020-11-04 3283
Fri 2020-11-05 3922
Sat 2020-11-06 3669
Sun 2020-11-07 4246
Mon 2020-11-08 4594
Tue 2020-11-09 4086
Wed 2020-11-10 4302
Thu 2020-11-11 4559
Fri 2020-11-12 4981
Sat 2020-11-13 4741
Sun 2020-11-14 5267
In order to count the number of time I observe the smallest of the values per week.
Mon = 1
Tue = 1
Wed = 0
Thu = 0
Fri = 0
Sat = 0
Sun = 0
I tried to let the data in the flat format before adding the date with zoo and added the weekdays but failed to count with it. Does anyone know an easier way to do it? I am open to visual solutions
question from:
https://stackoverflow.com/questions/65649498/how-to-get-the-lowest-value-per-interval-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…