I have a financial dataset.
dat = data.frame(Fundemental = rep(c("EPS", "ROE"), 2),
Dates = c("2019-01-01", "2019-01-01", "2019-02-02", "2019-02-02"),
Value = rnorm(4))
##
Fundemental Dates Value
1 EPS 2019-01-01 2.0685114
2 ROE 2019-01-01 -0.4700701
3 EPS 2019-02-02 0.3254684
4 ROE 2019-02-02 -0.6270476
Is there a quick way in dplyr to group the data frame by date so the data.frame has column names c(Dates, Value, ROE, EPS) and looks something like this.
Dates EPS Value ROE Value
1 2019-01-01 2.0685114 0.3254684
2 2019-02-02 -0.4700701 0.6270046
I wrote some code using the Map function, but I really feel like it's over kill! Thanks in advance.