I am trying to nest two subset data inside aggregate. but it returns different length of data and hence unable to compute. What options do i have?
newfile<- aggregate(cbind(subset(IVA,IVA$IVR.Agent =="Agent"),subset(IVA,IVA$IVR.Agent=="IVR")) ~ IVA$OrderNo, FUN = length, rm.action = TRUE)
Below is the error that I got
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 25039, 4585
I am trying to make a pivot table that will show Agent count and IVR count in separate columns just like in excel, if for a specific order there is no IVR it shows null otherwise its count.
DataSet looks like this
OrderNo IVR/Agent
A1 IVR
B1 Agent
A2 Agent
B2 IVR
A3 Agent
B3 Agent
A4 Agent
B4 Agent
A5 IVR
B5 Agent