Skip to content

Don't duplicate source name in names(covidcast_epidata()$signals) #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brookslogan opened this issue Jan 20, 2023 · 1 comment · Fixed by #118 or #146
Closed

Don't duplicate source name in names(covidcast_epidata()$signals) #64

brookslogan opened this issue Jan 20, 2023 · 1 comment · Fixed by #118 or #146
Assignees
Labels
P0 Top priority

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Jan 20, 2023

library(epidatr)
head(names(covidcast_epidata()$signals))
#> [1] "chng.chng:smoothed_outpatient_cli"      
#> [2] "chng.chng:smoothed_adj_outpatient_cli"  
#> [3] "chng.chng:smoothed_outpatient_covid"    
#> [4] "chng.chng:smoothed_adj_outpatient_covid"
#> [5] "chng.chng:smoothed_outpatient_flu"      
#> [6] "chng.chng:smoothed_adj_outpatient_flu"

Created on 2023-01-20 by the reprex package (v2.0.1)

This probably just requires adding an unname before c-ing the per-source signal lists together:

    all_signals <- do.call(c, lapply(sources, function(x) {
        l <- c(x$signals)
        names(l) <- paste(x$source, names(l), sep = ":")
        l
    }))

->

    all_signals <- do.call(c, unname(lapply(sources, function(x) {
        l <- c(x$signals)
        names(l) <- paste(x$source, names(l), sep = ":")
        l
    })))
  • updating docs, tests, etc.

Marking this P0, as fixing it is a breaking change for the entire covidcast_epidata()$signals interface.

@dsweber2
Copy link
Contributor

apparently I didn't solve this, caught by @dshemetov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Top priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants