Closed daxkellie closed 4 months ago
Found by @fontikar, galah_filter() doesn't correctly parse apostrophes when using %in%
galah_filter()
%in%
library(galah) names <- c("Australia's Virtual Herbarium", "iNaturalist observations", "iNaturalist research-grade observations") # doesn't work galah_call() |> filter(datasetName %in% names) |> atlas_counts() #> Error in parse(text = x, keep.source = FALSE): <text>:1:27: unexpected symbol #> 1: datasetName == 'Australia's #> ^ # works galah_call() |> galah_filter(datasetName == "Australia's Virtual Herbarium") |> atlas_counts() #> # A tibble: 1 × 1 #> count #> <int> #> 1 269620
Created on 2023-11-28 with reprex v2.0.2
The current solution is to use escaping with \\
\\
names <- c("Australia\\'s Virtual Herbarium", # fixed "iNaturalist observations", "iNaturalist research-grade observations") # works galah_call() |> filter(datasetName %in% names) |> atlas_counts() #> # A tibble: 1 × 1 #> count #> <int> #> 1 6025188
Fixed as of v2.0.1, test added in commit https://github.com/AtlasOfLivingAustralia/galah-R/commit/0e8428f23ecfdb021eef3011212032553c60078b
Found by @fontikar,
galah_filter()
doesn't correctly parse apostrophes when using%in%
Created on 2023-11-28 with reprex v2.0.2
The current solution is to use escaping with
\\
Created on 2023-11-28 with reprex v2.0.2