I have a simple data frame
SubjectID ImgTP ScanDate
1 01-001 B0 2019-06-28
2 01-001 PO 2019-06-30
3 01-001 W02 2019-07-09
4 01-001 W06 2019-08-15
5 01-001 W12 2019-09-13
6 01-001 W24 2019-12-13
7 01-001 INT01 2019-07-25
8 01-001 INT02 2019-10-25
9 01-002 B0 2019-07-25
10 01-002 PO 2019-07-26
11 01-002 W02 2019-08-15
12 01-002 W06 2019-09-05
13 01-002 W12 2019-10-24
14 01-002 W24 2020-01-23
I want to create a table the has SubjectID
vs TP
and displays date in the cell.
basic_table <- dcast(myDataArm, SubjectID ~ ImgTP, value.var = "ScanDate",
fun.aggregate = function(x) lubridate::as_date(x), fill = 0)
However the dates in the table are reported as numbers. Why is it not displaying correctly?