0
的數據幀我在R中長格式這個數據幀看起來是這樣的..重塑中的R
Branch.Name Customer.ID Loan.Type Date Stage Time
A C001 Home 20/11/05 Processing 10
A C001 Home 20/11/05 Approval 30
A C001 Home 20/11/05 Finalize 5
A C002 Business 23/11/05 Processing 30
,我想這個轉換爲寬幅..
Branch.Name Customer.ID Loan.Type Date Processing Approval Finalize
A C001 Home 20/11/05 10 30 5
B C002 Business 20/11/05 30 10 0
B C003 Business 20/11/05 12 15 0
我看着改造並融化,但還是搞砸了答案......
在此先感謝
PS:不是所有的行有「公關,「批准」和「敲定」爲舞臺,有些可能會有額外的階段
我想你'Branch.Name'輸入數據應該有'B」。也許'庫(reshape2); dcast(df1,...〜Stage,value.var ='Time',fill = 0)' – akrun