{"action":"opened","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/879","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/879/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/879/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/879/events","html_url":"https://github.com/hadley/dplyr/issues/879","id":53973253,"number":879,"title":"Performance issue with filter","user":{"login":"ozagordi","id":2485331,"avatar_url":"https://avatars.githubusercontent.com/u/2485331?v=3","gravatar_id":"","url":"https://api.github.com/users/ozagordi","html_url":"https://github.com/ozagordi","followers_url":"https://api.github.com/users/ozagordi/followers","following_url":"https://api.github.com/users/ozagordi/following{/other_user}","gists_url":"https://api.github.com/users/ozagordi/gists{/gist_id}","starred_url":"https://api.github.com/users/ozagordi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozagordi/subscriptions","organizations_url":"https://api.github.com/users/ozagordi/orgs","repos_url":"https://api.github.com/users/ozagordi/repos","events_url":"https://api.github.com/users/ozagordi/events{/privacy}","received_events_url":"https://api.github.com/users/ozagordi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-10T22:10:55Z","updated_at":"2015-01-10T22:10:55Z","closed_at":null,"body":"I noticed a tremendously slow performance with filter that I can't understand. I want to extract some rows based on the value of column X.\r\n\r\n    with_filter = function(mydata){\r\n      sesa = mydata %>%\r\n        filter(X != \"Bad sample-Do not use\")\r\n    }\r\n    without_filter = function(mydata){\r\n      sesa = mydata[mydata$X != \"Bad sample-Do not use\", ]\r\n    }\r\n\r\nI have a data frame with 70 rows and more than 23 thousand columns, and this is the performance\r\n\r\n    > dim(gexp)\r\n    [1]    70 23640\r\n    > system.time(with_filter(gexp))\r\n       user  system elapsed \r\n     14.267   0.050  14.337 \r\n    > system.time(without_filter(gexp))\r\n       user  system elapsed \r\n      0.491   0.005   0.495 \r\n\r\nThe non-dplyr method is about 30 times faster, how come?\r\n\r\nThanks."}}