Skip to content
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

dplyr::filter should not be preferred over stats::filter for numerical vectors #264

Closed
holgerbrandl opened this issue Feb 14, 2014 · 0 comments
Closed
Milestone

Comments

@holgerbrandl
Copy link

@holgerbrandl holgerbrandl commented Feb 14, 2014

This example is copied from R help (filter {stats}):

x <- 1:100
filter(x, rep(1, 3))

It's just calculating an moving average.

However after loading dplyr package (latest version from todays github), dplyr::filter seems to also apply to numerical vectors as well:

library(dplyr)
filter(x, rep(1, 3))

Error in UseMethod("filter") :
no applicable method for 'filter' applied to an object of class "c('integer', 'numeric')"

Imho stats::filter should be still applied by default for numerical vectors.

@hadley hadley added this to the v0.1.2 milestone Feb 17, 2014
@hadley hadley closed this in 658d096 Feb 17, 2014
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants