Skip to content
Prev 336752 / 398513 Next

count and sum simultaneously in R pivot table

The script works nicely, Arun.  You were right, I pasted code from email instead of Rhelp and didn't reformat properly in R.  I appreciate your time with this!

-----Original Message-----
It seems like part of the next line is also being run (in the end 'colnames').
For e.g.
res2 <- within(as.data.frame(res1),`Count of Case ID` <- dcast(FLSAdata_melt, ViolationDesc + ReasonDesc ~ variable, length, margins=TRUE)[,3])[,c(4,1:3)] colnames
#Error: unexpected symbol in "res2 <- within(as.data.frame(res1),`Count of Case ID` <- #dcast(FLSAdata_melt, ViolationDesc + ReasonDesc ~ variable, length, margins=TRUE)#[,3])[,c(4,1:3)] colnames"
Message-ID: <559C998F7039D84C9793AE43D9BBE9CE9F2E0912@kmbx4.utk.tennessee.edu>
In-Reply-To: <1392737284.3606.YahooMailNeo@web142605.mail.bf1.yahoo.com>