Group Results
hal_group(x, ...)
# S3 method for HALQuery
hal_group(x, field, limit = 1, sort = "score", decreasing = FALSE, ...)
An object of class HALQuery
(typically returned by hal_api()
).
Currently not used.
A character
string specifying the field to group by.
An integer
giving the maximum number of results per group.
A character
string specifying the field to be used to sort
the results.
A logical
scalar: should the sort be increasing or
decreasing?
An object of class HALQuery
.
Other query tools:
hal_facet()
,
hal_filter()
,
hal_query()
,
hal_select()
,
hal_sort()
if (FALSE) {
library(magrittr)
## Most recent publication by journal
hal_api() %>%
hal_query("archéologie") %>%
hal_select("producedDate_tdate") %>%
hal_filter("ART" %IN% "docType_s") %>%
hal_sort("producedDate_tdate", decreasing = TRUE) %>%
hal_group(field = "journalTitle_s", limit = 1,
sort = "producedDate_tdate", decreasing = TRUE) %>%
hal_search(limit = 10)
}