Skip to content

Commit 8310e34

Browse files
dsweber2dshemetov
andauthored
Update R/covidcast.R
Co-authored-by: Dmitry Shemetov <[email protected]>
1 parent bb97692 commit 8310e34

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/covidcast.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,18 @@ parse_source <- function(source, base_url) {
6969
#' @export
7070
as_tibble.covidcast_data_signal_list <- function(x, ...) {
7171
tib <- list()
72-
fields <- c(
73-
"source", "signal", "name", "active", "short_description",
72+
chr_fields <- c(
73+
"source", "signal", "name", "short_description",
7474
"description", "time_type", "time_label", "value_label",
7575
"format", "category", "high_values_are"
7676
)
77-
for (field in fields) {
77+
for (field in chr_fields ) {
7878
tib[[field]] <- unname(map_chr(x, field, .default = ""))
7979
}
80+
lgl_fields <- c("active")
81+
for (field in lgl_fields ) {
82+
tib[[field]] <- unname(map_lgl(x, field, .default = ""))
83+
}
8084
as_tibble(tib)
8185
}
8286

0 commit comments

Comments
 (0)