hal_group: Group Results

View source: R/AllGenerics.R

hal_groupR Documentation

Group Results

Description

Group Results

Usage

hal_group(x, ...)

## S3 method for class 'HALQuery'
hal_group(x, field, limit = 1, sort = "score", decreasing = FALSE, ...)

Arguments

x

An object of class HALQuery (typically returned by hal_api()).

...

Currently not used.

field

A character string specifying the field to group by.

limit

An integer giving the maximum number of results per group.

sort

A character string specifying the field to be used to sort the results.

decreasing

A logical scalar: should the sort be increasing or decreasing?

Value

An object of class HALQuery.

Author(s)

N. Frerebeau

See Also

Other query tools: hal_facet(), hal_filter(), hal_query(), hal_select(), hal_sort()

Examples

## Not run: 
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)

## End(Not run)

nfrerebeau/odyssey documentation built on March 30, 2022, 2:51 p.m.