Closed ateucher closed 5 years ago
This is actually a 'feature' of the latest dbplyr release - the intention is to evaluate tables with those names in the backend database. To evaluate them locally, they need to be unquoted:
library(bcdata)
#>
#> Attaching package: 'bcdata'
#> The following object is masked from 'package:stats':
#>
#> filter
x <- c("airport", "heliport")
bcdc_query_geodata("bc-airports") %>%
filter(DESCRIPTION == !!x[1]) %>%
show_query()
#> Warning: It is advised to use the permanent id ('76b1b7a3-2112-4444-857a-
#> afccf7b20da8') rather than the name of the record ('bc-airports')to guard
#> against future changes
#> <url>
#> https://openmaps.gov.bc.ca/geo/pub/wfs?
#> SERVICE=WFS&
#> VERSION=2.0.0&
#> REQUEST=GetFeature&
#> outputFormat=application%2Fjson&
#> typeNames=WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW&
#> SRSNAME=EPSG%3A3005
#> <SQL>
#> ("DESCRIPTION" = 'airport')
y <- data.frame(type = c("airport", "heliport"))
bcdc_query_geodata("bc-airports") %>%
filter(DESCRIPTION %in% !!y$type) %>%
show_query()
#> <url>
#> https://openmaps.gov.bc.ca/geo/pub/wfs?
#> SERVICE=WFS&
#> VERSION=2.0.0&
#> REQUEST=GetFeature&
#> outputFormat=application%2Fjson&
#> typeNames=WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW&
#> SRSNAME=EPSG%3A3005
#> <SQL>
#> ("DESCRIPTION" IN ('airport', 'heliport'))
Created on 2019-05-02 by the reprex package (v0.2.1)
!!
Created on 2019-05-02 by the reprex package (v0.2.1)