{"action":"closed","issue":{"url":"https://api.github.com/repos/tidyverse/dplyr/issues/3374","repository_url":"https://api.github.com/repos/tidyverse/dplyr","labels_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3374/labels{/name}","comments_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3374/comments","events_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3374/events","html_url":"https://github.com/tidyverse/dplyr/issues/3374","id":299405806,"number":3374,"title":"filter can not use inline pull","user":{"login":"JohnMount","id":4275344,"avatar_url":"https://avatars2.githubusercontent.com/u/4275344?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnMount","html_url":"https://github.com/JohnMount","followers_url":"https://api.github.com/users/JohnMount/followers","following_url":"https://api.github.com/users/JohnMount/following{/other_user}","gists_url":"https://api.github.com/users/JohnMount/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnMount/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnMount/subscriptions","organizations_url":"https://api.github.com/users/JohnMount/orgs","repos_url":"https://api.github.com/users/JohnMount/repos","events_url":"https://api.github.com/users/JohnMount/events{/privacy}","received_events_url":"https://api.github.com/users/JohnMount/received_events","type":"User","site_admin":false},"labels":[{"id":213548409,"url":"https://api.github.com/repos/tidyverse/dplyr/labels/database","name":"database","color":"eeeeee","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-22T15:52:33Z","updated_at":"2018-05-20T14:17:05Z","closed_at":"2018-05-20T14:17:04Z","author_association":"NONE","body":"\r\nIn the example below we can use the value of a `pull` inside a `filter`, if it is first landed in a variable.  But we can not use the `pull` directly in an filter expression.\r\n\r\n\r\n``` r\r\nlibrary(\"dplyr\")\r\n\r\n    ## \r\n    ## Attaching package: 'dplyr'\r\n\r\n    ## The following objects are masked from 'package:stats':\r\n    ## \r\n    ##     filter, lag\r\n\r\n    ## The following objects are masked from 'package:base':\r\n    ## \r\n    ##     intersect, setdiff, setequal, union\r\n\r\ndb <- DBI::dbConnect(RSQLite::SQLite(),\r\n                     \":memory:\")\r\ntable <- dplyr::copy_to(db,\r\n                        data.frame(idx = 1:5))\r\nt2 <- dplyr::copy_to(db,\r\n                        data.frame(idx = 1:2))\r\n\r\n\r\n# works\r\nvals <- pull(t2, idx)\r\ntable %>% filter(idx %in% vals)\r\n\r\n    ## # Source:   lazy query [?? x 1]\r\n    ## # Database: sqlite 3.19.3 [:memory:]\r\n    ##     idx\r\n    ##   <int>\r\n    ## 1     1\r\n    ## 2     2\r\n\r\n# throws\r\ntable %>% filter(idx %in% pull(t2, idx))\r\n\r\n    ## Error in UseMethod(\"escape\"): no applicable method for 'escape' applied to an object of class \"c('tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')\"\r\n\r\nDBI::dbDisconnect(db)\r\n```\r\n"}}
{"actor":{"display_login":"hadley"}}