I have a small dataset of daily return of stocks and I have to write a function which finds the highest return and extracts the day it occurred. Any suggestion how I do so?
This is the dataset:
> df
VWD_RET DATE Daily_Return
1 0.009312 2015-03-20 Fri
2 -0.001045 2015-03-23 Mon
3 -0.004701 2015-03-24 Tue
4 -0.014949 2015-03-25 Wed
5 -0.002183 2015-03-26 Thu
6 0.002501 2015-03-27 Fri
7 0.011713 2015-03-30 Mon
8 -0.007162 <NA> <NA>
>