the data frame looks like below.
Cust Month Amount
cust1 Jan 2015 100
cust1 Feb 2015 200
cust1 Mar 2015 300
cust1 Apr 2015 400
cust2 Mar 2015 800
cust2 Apr 2015 900
i need in the below format.
Cust Jan 2015 Feb 2015 Mar 2015 Apr 2015
cust1 100 200 300 400
cust2 na na 800 900
Note : Yearmon should be in order while reshaping. if the customer has no data for a particular month. then it must be replaced with zero.
please suggest me on how to go ahead. i tried using reshape function, but yearmon is not in order.
i want the month column to be in order for forecasting customer amount
Thanks in advance.