dataverse_search {dataverse}R Documentation

Search Dataverse server

Description

Search for Dataverses and datasets

Usage

dataverse_search(
  ...,
  type = c("dataverse", "dataset", "file"),
  subtree = NULL,
  sort = c("name", "date"),
  order = c("asc", "desc"),
  per_page = 10,
  start = NULL,
  show_relevance = FALSE,
  show_facets = FALSE,
  fq = NULL,
  key = Sys.getenv("DATAVERSE_KEY"),
  server = Sys.getenv("DATAVERSE_SERVER"),
  verbose = TRUE,
  http_opts = NULL
)

Arguments

...

A length-one character vector specifying a search query, a named character vector of search arguments, or a sequence of named character arguments. The specific fields available may vary by server installation.

type

A character vector specifying one or more of “dataverse”, “dataset”, and “file”, which is used to restrict the search results. By default, all three types of objects are searched for.

subtree

Currently ignored.

sort

A character vector specifying whether to sort results by “name” or “date”.

order

A character vector specifying either “asc” or “desc” results order.

per_page

An integer specifying the page size of results.

start

An integer specifying used for pagination.

show_relevance

A logical indicating whether or not to show details of which fields were matched by the query

show_facets

A logical indicating whether or not to show facets that can be operated on by the fq parameter

fq

See API documentation.

key

A character string specifying a Dataverse server API key. If one is not specified, functions calling authenticated API endpoints will fail. Keys can be specified atomically or globally using Sys.setenv("DATAVERSE_KEY" = "examplekey").

server

A character string specifying a Dataverse server. Multiple Dataverse installations exist, with "dataverse.harvard.edu" being the most major. The server can be defined each time within a function, or it can be set as a default via an environment variable. To set a default, run Sys.setenv("DATAVERSE_SERVER" = "dataverse.harvard.edu") or add ⁠DATAVERSE_SERVER = "dataverse.harvard.edu⁠ in one's .Renviron file (usethis::edit_r_environ()), with the appropriate domain as its value.

verbose

A logical indicating whether to display information about the search query (default is TRUE).

http_opts

Currently ignored.

dataverse

A character string specifying a Dataverse name or an object of class “dataverse”.

Details

This function provides an interface for searching for Dataverses, datasets, and/or files within a Dataverse server.

Value

A list.

See Also

get_file, get_dataverse, get_dataset, dataverse_contents

Examples

## Not run: 
# simple string search
dataverse_search("Gary King")

# search using named arguments
dataverse_search(c(author = "Gary King", title = "Ecological Inference"))
dataverse_search(author = "Gary King", title = "Ecological Inference")

# search only for datasets
dataverse_search(author = "Gary King", type = "dataset")

## End(Not run)

[Package dataverse version 0.3.10 Index]