Skip to content

Commit 8563225

Browse files
dajmcdondshemetov
authored andcommitted
simplify avail_endpoints.R
See comment on #154
1 parent 42a0fbe commit 8563225

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

R/avail_endpoints.R

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
#' endps <- avail_endpoints()
99
#' print(endps, n = nrow(endps))
1010
avail_endpoints <- function() {
11-
db <- utils::hsearch_db("epidatr")
12-
endpoint_ids <- db$Concepts$ID[db$Concepts$Concept == "endpoint"]
13-
all_ids <- db$Base$ID
14-
our_endpoints <- all_ids %in% endpoint_ids
11+
h <- help.search("endpoint", package = "epidatr", fields = "concept")$matches
1512
tib <- tibble::tibble( # printing is much nicer than data.frame
16-
Endpoint = paste0(db$Base$Name[our_endpoints], "()"),
17-
Description = db$Base$Title[our_endpoints]
13+
Endpoint = paste0(h$Name, "()"),
14+
Description = h$Title
1815
)
1916
tib
2017
}

0 commit comments

Comments
 (0)