Rowwise to complement colwise #124

Closed
hadley opened this Issue Dec 14, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@hadley
Owner

hadley commented Dec 14, 2012

Suggested by Bob Muenchen.

@krlmlr

This comment has been minimized.

Show comment Hide comment
@krlmlr

krlmlr Mar 7, 2014

Contributor

How about implementing this when .variables is NA? Currently:

> ddply(iris, .variables = NA, identity)
Error in UseMethod("as.quoted") : 
  no applicable method for 'as.quoted' applied to an object of class "logical"

I suggest changing this to calling the function for each row. Then,

rowwise <- function(...) d_ply(.variables = NA, ...)

Would you review a pull request?

Contributor

krlmlr commented Mar 7, 2014

How about implementing this when .variables is NA? Currently:

> ddply(iris, .variables = NA, identity)
Error in UseMethod("as.quoted") : 
  no applicable method for 'as.quoted' applied to an object of class "logical"

I suggest changing this to calling the function for each row. Then,

rowwise <- function(...) d_ply(.variables = NA, ...)

Would you review a pull request?

@hadley

This comment has been minimized.

Show comment Hide comment
@hadley

hadley Mar 10, 2014

Owner

Hmmm, NA doesn't clearly say rowwise to me

Owner

hadley commented Mar 10, 2014

Hmmm, NA doesn't clearly say rowwise to me

@krlmlr

This comment has been minimized.

Show comment Hide comment
@krlmlr

krlmlr Mar 10, 2014

Contributor

Unfortunately, NULL is equivalent to the empty list, and anything else might be interpreted as columns. What would you suggest?

I'm suggesting the enhancement of d*ply because this might be the easiest path, involving the least amount of changes and new code. It's still possible to refactor the d*ply functions to provide a worker so that the interface of d*ply remains unchanged. Would that be preferable?

Contributor

krlmlr commented Mar 10, 2014

Unfortunately, NULL is equivalent to the empty list, and anything else might be interpreted as columns. What would you suggest?

I'm suggesting the enhancement of d*ply because this might be the easiest path, involving the least amount of changes and new code. It's still possible to refactor the d*ply functions to provide a worker so that the interface of d*ply remains unchanged. Would that be preferable?

@hadley

This comment has been minimized.

Show comment Hide comment
@hadley

hadley Mar 10, 2014

Owner

That's a good point. I'd review a pull request, but I'm spending more time on dplyr these days.

Owner

hadley commented Mar 10, 2014

That's a good point. I'd review a pull request, but I'm spending more time on dplyr these days.

@hadley

This comment has been minimized.

Show comment Hide comment
@hadley

hadley Mar 30, 2015

Owner

In dplyr, and it's too big to consider for plyr now.

Owner

hadley commented Mar 30, 2015

In dplyr, and it's too big to consider for plyr now.

@hadley hadley closed this Mar 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment