hal_sort: Sort Results

View source: R/query.R View source: R/AllGenerics.R

hal_sortR Documentation

Sort Results

Description

Sort Results

Usage

hal_sort(x, field, decreasing = FALSE, ...)

hal_sort(x, field, decreasing = FALSE, ...)

Arguments

x

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

field

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

decreasing

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

...

Currently not used.

Value

An object of class HALQuery.

Author(s)

N. Frerebeau

See Also

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

Examples

library(magrittr)

## Select fields
hal1 <- hal_api() %>% hal_sort("docid")
hal1$sort

## Update query
hal2 <- hal_sort(hal1, "producedDate_tdate", decreasing = TRUE)
hal2$sort

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