I have about 15 data frames that each look like the below example. Each data frame represents the number of faults a machine has had on a given day for the 12 months 2019-07-01 to 2020-06-30
Machine #1
# date n
# 1 2019-07-01 8
# 2 2019-07-02 6
# 3 2019-07-03 10
# 4 2019-07-05 1
# 5 2019-07-06 2
# 6 2019-07-08 6
# . .......... .
# n 2020-06-30 5
I would like to use this tool here at Flourish Studio to create a bar chart race, but need my data to be of the form;
Machine Number 2019-07-01 2019-07-02 2019-07-03 2019-07-04 2019-07-05 ...... 2020-06-30
# 1 1 8 6 10 0 1 5
# 2 2 0 4 3 1 0 3
# 3 3 2 0 1 3 5 6
# 4 4 3 1 0 0 9 11
# . . . . . . . .
# 15 15 10 8 4 6 0 1
So essentially I need to end up with a data frame of 15 rows and 366 columns (one for machine number and 365 for each day of the year)
One important thing to note is that if no faults are reported on a given day, no data is recorded, in other words there are no zeros in any of the data frames, they would need to be added where needed somehow.
I am an absolute beginner and it's taken me weeks just to wrangle the data into its current form, and at this point I'm not sure how to proceed. So any help would be greatly appreciated.
Thanks.