Skip to content

Commit 100b467

Browse files
committed
Lint pass
1 parent 067fcf8 commit 100b467

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

R/check.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ check_string_param <- function(name, value, required = TRUE) {
1111
}
1212

1313
check_int_param <- function(name, value, required = TRUE) {
14-
# string or string[]
14+
# numeric or numeric[]
1515
if ((required &&
1616
!(!is.null(value) &&
1717
is.numeric(value))) ||
@@ -23,24 +23,24 @@ check_int_param <- function(name, value, required = TRUE) {
2323
}
2424

2525
is_epirange_like <- function(value) {
26+
# character or numeric or EpiRange or list(from=..., to=...)
2627
is.character(value) ||
2728
is.numeric(value) ||
2829
inherits(value, "EpiRange") ||
2930
(is.list(value) &&
3031
"from" %in% names(value) && "to" %in% names(value))
3132
}
3233

33-
check_single_epirange_param <-
34-
function(name, value, required = TRUE) {
35-
if ((required &&
36-
!(!is.null(value) &&
37-
is_epirange_like(value))) ||
38-
(!required && !(is.null(value) || is_epirange_like(value)))) {
39-
rlang::abort(paste0("argument ", name, " is not a epirange"),
40-
name = name, value = value, class = "invalid_argument"
41-
)
42-
}
34+
check_single_epirange_param <- function(name, value, required = TRUE) {
35+
if ((required &&
36+
!(!is.null(value) &&
37+
is_epirange_like(value))) ||
38+
(!required && !(is.null(value) || is_epirange_like(value)))) {
39+
rlang::abort(paste0("argument ", name, " is not a epirange"),
40+
name = name, value = value, class = "invalid_argument"
41+
)
4342
}
43+
}
4444

4545
check_epirange_param <- function(name, value, required = TRUE) {
4646
if (is.null(value)) {

R/covidcast.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ covidcast_epidata <- function(base_url = global_base_url) {
100100
url <- join_url(base_url, "covidcast/meta")
101101
res <- do_request(url, list())
102102

103-
httr::stop_for_status(res)
104-
r <- httr::content(res, "text", encoding = "UTF-8")
105-
meta <- jsonlite::fromJSON(r, simplifyVector = FALSE)
103+
stop_for_status(res)
104+
r <- content(res, "text", encoding = "UTF-8")
105+
meta <- fromJSON(r, simplifyVector = FALSE)
106106

107107
sources <- do.call(c, lapply(meta, parse_source, base_url = base_url))
108108
class(sources) <- c("covidcast_data_source_list", class(sources))

0 commit comments

Comments
 (0)