Skip to content

Commit

Permalink
fix: get_keywords to use get_datasetlevel_element instead #2 #9
Browse files Browse the repository at this point in the history
  • Loading branch information
atn38 committed Apr 27, 2022
1 parent 77cc7db commit f58a323
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions R/get_keywords.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@
#'
#' @examples
get_keywords <- function(corpus) {
vw <- list()
for (i in seq_along(corpus)) {
pk <- parse_packageId(names(corpus)[[i]])
scope <- pk[["scope"]]
id <- pk[["id"]]
rev <- pk[["rev"]]
klist <- list()
if ("keywordSet" %in% names(corpus[[i]][["dataset"]])) {
keysets <- handle_one(corpus[[i]][["dataset"]][["keywordSet"]])
klist <-
data.table::rbindlist(lapply(seq_along(keysets), function(x) parse_keywordset(keysets[[x]])), fill = TRUE)
klist$id <- id
klist$scope <- scope
klist$rev <- rev
klist <- subset(klist, select = c(4:6, 1:3))
}
vw[[i]] <- klist
}
return(data.table::rbindlist(vw))
get_datasetlevel_element(corpus, "keywordSet", parse_keywordset)
}

#' Title
Expand Down

0 comments on commit f58a323

Please sign in to comment.