locations <- data.frame(id = "E309447")
library(rems)
library(dplyr)
hist_db <- attach_historic_data()
filtered_historic <- hist_db %>%
filter(EMS_ID %in% locations$id) %>%
collect()
#> Error: Cannot embed a data frame in a SQL query.
#>
#> If you are seeing this error in code that used to work, the most likely
#> cause is a change dbplyr 1.4.0. Previously `df$x` or `df[[y]]` implied
#> that `df` was a local variable, but now you must make that explict with
#> `!!` or `local()`, e.g., `!!df$x` or `local(df[["y"]))
filtered_historic <- hist_db %>%
filter(EMS_ID %in% !!locations$id) %>% # Add the !! as directed by the error message
collect()
# OR local()
filtered_historic <- hist_db %>%
filter(EMS_ID %in% local(locations$id)) %>%
collect()
Created on 2019-12-18 by the reprex package (v0.3.0)