Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rowwise to complement colwise #124

Closed
hadley opened this Issue · 5 comments

2 participants

@hadley
Owner

Suggested by Bob Muenchen.

@krlmlr

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
Owner

Hmmm, NA doesn't clearly say rowwise to me

@krlmlr

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
Owner

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

@hadley
Owner

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

@hadley hadley closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.