Skip to contents

Count

Usage

hal_count(query, ...)

# S3 method for class 'HALQuery'
hal_count(query, path = "search", instance = NULL, ...)

Arguments

query

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

...

Currently not used.

path

A character string giving the API name (defaults to "search").

instance

A character string giving the HAL portal name.

Value

An integer (the number of results).

See also

Other search tools: hal_download(), hal_search()

Author

N. Frerebeau

Examples

if (FALSE) { # \dontrun{
## Simple search
topic <- list("archéologie", "Celtes", "France") # Combined with AND
## Get the first ten results
hal_query(topic) |>
  hal_search(limit = 10) |>
  as.data.frame()
## Get all results
hal_query(topic) |>
  hal_search(limit = 30, cursor = TRUE) |>
  as.data.frame()

## Get a list of archaeological journals
topic <- c("archéologie", "archaeology", "archäologie") # Combined with OR
hal_query(topic) |>
  hal_select("title_s", "issn_s") |>
  hal_filter("" %TO% "*" %IN% "issn_s") |>
  hal_sort("title_s") |>
  hal_search(path = "ref", instance = "journal") |>
  as.data.frame()

## Get a list of archaeological laboratories
## (only joint laboratories of the CNRS and a French university)
topic <- list("archéologie" %IN% "text", "UMR" %IN% "code_t")
hal_query(topic) |>
  hal_select("name_s", "acronym_s", "code_s") |>
  hal_filter("VALID" %IN% "valid_s") |>
  hal_sort("acronym_s", decreasing = TRUE) |>
  hal_search(path = "ref", instance = "structure", limit = 15) |>
  as.data.frame()
} # }