hal_filter: Filter Results

View source: R/AllGenerics.R

hal_filterR Documentation

Filter Results

Description

Filter Results

Usage

hal_filter(x, ...)

## S3 method for class 'HALQuery'
hal_filter(x, value, field = NULL, ...)

Arguments

x

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

...

Currently not used.

value

A character string specifying the value to be used to filter the results.

field

A character string specifying the field to filter along.

Value

An object of class HALQuery.

Author(s)

N. Frerebeau

See Also

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

Examples

library(magrittr)

## Simple filer
hal1 <- hal_api() %>% hal_filter("file", "submitType_s")
hal1$fq

## Advanced filter
hal2 <- hal_api() %>% hal_filter(c("THESE", "HDR"), "docType_s")
hal2$fq

## Multiple filters
hal3 <- hal_api() %>%
  hal_filter("[NOW-1MONTHS/DAY TO NOW/HOUR]", "submittedDate_tdate") %>%
  hal_filter("-notice", "submitType_s")
hal3$fq

## Range filters
hal4 <- hal_api() %>% hal_filter("[2000 TO 2013]", "submittedDateY_i")
hal4$fq

hal5 <- hal_api() %>% hal_filter("[Aa TO Ab]", "city_s")
hal5$fq

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