Thank you for your reading. I often find that I need to apply a function to slices of my data, and then bind the outputs. I usually build a loop for that purpose, but I am s
The plyr
package was built specifically to deal with data manipulation problems like this. Check out some of the documentation on the webpage: http://had.co.nz/plyr/
I don't exactly understand the round()
syntax you used, but I believe an equivalent plyr
call would be
library(plyr)
ddply(s1, .(obs, session), transform, ds = round(clfdMc, 2), cs = round(cfdMc, 2))
I'm not exactly sure this will do what you want. Your code is a little opaque.