Suspicion: you are only passing 1 element over at a time, meaning that you are calculating the test on a single value instead of the vector of values. For instance, if you ran "chisq.test(c(1))" in R, you would get the same error message.
To verify whether this is the case:
1. Start Rserve using run.Rserve() (this keeps it in the session so any print statements will appear in R Studio instead of being swallowed)
2. Replace the code with the following:
print("arg1 is ")
print("which has size ")
mm <- data.frame(commodity = .arg1);
d <- split(mm,rep(1:.arg3,each=.arg2/.arg3));
zt <-do.call(cbind, d);
print("Taking chisq.test of ")
,SUM([Number of Records]), SIZE(),[Priorities])
That will give you a sense of what exactly is being passed to R.
Let me know what that says and I might be able to help further. A sample workbook, even just with some dummy data, would also be really helpful.