I have a csv that looks a bit like this (tabs added for readability):
Dimension, Date, Metric
A, Mon, 23
A, Tues, 25
B, Mon, 7
B, Tues, 9
I want to run some distance + hclust analysis, which I've done before. But I like (and perhaps need) it in this format:
Dimension, Mon, Tues
A, 23, 25
B, 7, 9
I could do this pretty easily in Excel with a pivot. The problem is I have ~10,000 dimensions and ~1,200 dates - so the source CSV is about 12M rows by 3 columns. I want ~10,000 rows by ~1,200 columns.
Is there a way I can do this transform in R? The logic of a little Python script to do this is simple, but I'm not sure how it'll handle such a large CSV - and I can't imagine this is a new issue. Don't want to reinvent the wheel!
Thanks for any tips :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…