I am looking for a way to transfor a data.frame with thousands of rows like this
code date value uname tcode
<chr> <date> <dbl> <ord> <int>
1 CODE1 1968-02-01 14.1 "" NA
2 CODE1 1968-03-01 9.50 "" NA
3 CODE1 1968-04-01 22.1 "" NA
4 CODE2 1968-02-01 15.1 "" NA
5 CODE2 1968-03-01 13.50 "" NA
6 CODE2 1968-04-01 23.1 "" NA
7 CODE3 1968-02-01 16.1 "" NA
8 CODE3 1968-03-01 15.50 "" NA
9 CODE3 1968-04-01 13.1 "" NA
Into something like:
date CODE1 CODE2 CODE3
<date> <dbl> <dbl> <dbl>
1 1968-02-01 14.1 15.1 16.1
2 1968-03-01 9.50 13.50 15.50
3 1968-04-01 22.1 23.1 13.1
This seems straightforward but I am having difficulty realizing this task. Thanks!