Skip to content

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

@brookslogan

Description

@brookslogan
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.

Metadata

Metadata

Assignees

Labels

P0Top priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions