New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Think about rowwise grouping #270
Comments
@romainfrancois any thoughts on implementing this? We could either abuse the existing grouping mechanism (as in the code example) or create a new class. I think the main use case will be in conjunction with |
Abusing the existing grouping mechanism is cheap, most functions will work (perhaps we would need to be careful about Conceptually, it might be interesting to structure the data differently so that internally we know there is only one index per group, but that might be quite an investment of time to implement versions that take advantage of that knowledge. Perhaps at least we could do:
so that we can adapt |
I think we also need to specialise summarise for that case (so we can conceptually use models <- mtcars %.% group_by(cyl) %.% do(mod = lm(mpg ~ vs, data = .)
models %.% summarise(rsq = summary(mod)$r.squared) currently you need models %.% summarise(rsq = summary(mod[[1]])$r.squared) |
|
Right. We could either add a flag or just use the additional class, as you suggested. |
I've put some code in so that:
With:
|
But most of the internal stuff knows about rowwise:
|
Thanks - this looks great! I'll fill in the missing pieces and then we should be good to submit to cran :) |
The text was updated successfully, but these errors were encountered: