Re: [R] dplyr: producing a good old data frame

2015-02-25 Thread Hadley Wickham
Hi John, Just printing the result gives a good indication where the problem lies: > frm %>% rowwise() %>% do(MM=max(as.numeric(.))) Source: local data frame [6 x 1] Groups: MM 1 2 3 4 5 6 do() is designed to produce scalars (e.g. a linear model), not vectors, so it doesn't join t

[R] dplyr: producing a good old data frame

2015-02-23 Thread John Posner
I'm using the dplyr package to perform one-row-at-a-time processing of a data frame: > rnd6 = function() sample(1:300, 6) > frm = data.frame(AA=rnd6(), BB=rnd6(), CC=rnd6()) > frm AA BB CC 1 123 50 45 2 12 30 231 3 127 147 100 4 133 32 129 5 66 235 71 6 38 264 261 The interface is