Cutting down code in dplyr and data.table

1 · John MacKintosh · Aug. 9, 2021, 9:28 p.m.
After a very long , R free hiatus ( it sucked, don’t recommend it) I’m back on the R train, destination unknown. I had a bit of spare time last night, and remembered I had not done a PreppinData challenge for a while. In fact, the last one I did was week 8, and they are now on week 31 - the exact details of the challenge can been seen below. PreppinData Week 31 In summary, we had to import the data filter to only include rows where products were sold calculate sales per item pivot the results ...