Summary
While using the documented comma-joined style for v5 signals, I hit a confusing failure: epidata_snapshot("nhsn", "pct_visits, urgent_care", "state") errors with "not an available signal" because the comma-split at R/endpoints.R:1576-1577 (and :1688-1689 in epidata_archive()) uses strsplit(..., fixed = TRUE) without trimws(), so the second signal arrives as " urgent_care" with a leading space. The comma-joined input style is the documented one (R/endpoints.R:1461-1462), so this is a small but real papercut; a trimws() before unique() fixes it.
Evidence (dev tip 87b10e1)
# R/endpoints.R:1576-1577 (epidata_snapshot; same at :1688-1689 in epidata_archive)
signals <- unique(unlist(strsplit(signals, ",", fixed = TRUE)))
geo_type <- unique(unlist(strsplit(geo_type, ",", fixed = TRUE)))
strsplit("pct_visits, urgent_care", ",", fixed = TRUE)
# [[1]] "pct_visits" " urgent_care" <- leading space preserved
Note: the in-flight PR #380 (send signals comma-joined in one request per geo_type) reworks this fan-out but keeps the same untrimmed split, so the papercut survives it.
Maintainer-runnable repro
epidata_snapshot("nhsn", "pct_visits, urgent_care", "state")
# error: " urgent_care" is not an available signal for source nhsn...
Suggested fix
signals <- unique(trimws(unlist(strsplit(signals, ",", fixed = TRUE))))
geo_type <- unique(trimws(unlist(strsplit(geo_type, ",", fixed = TRUE))))
(applied in both epidata_snapshot() and epidata_archive()).
I checked for prior reports (open/closed issues about signal names or the comma style — #380's PR is the in-flight rework) and found none covering the trimming.
Summary
While using the documented comma-joined style for v5 signals, I hit a confusing failure:
epidata_snapshot("nhsn", "pct_visits, urgent_care", "state")errors with "not an available signal" because the comma-split atR/endpoints.R:1576-1577(and:1688-1689inepidata_archive()) usesstrsplit(..., fixed = TRUE)withouttrimws(), so the second signal arrives as" urgent_care"with a leading space. The comma-joined input style is the documented one (R/endpoints.R:1461-1462), so this is a small but real papercut; atrimws()beforeunique()fixes it.Evidence (dev tip 87b10e1)
Note: the in-flight PR #380 (send signals comma-joined in one request per geo_type) reworks this fan-out but keeps the same untrimmed split, so the papercut survives it.
Maintainer-runnable repro
Suggested fix
(applied in both
epidata_snapshot()andepidata_archive()).I checked for prior reports (open/closed issues about signal names or the comma style — #380's PR is the in-flight rework) and found none covering the trimming.