Search for Dataverses and datasets
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
)
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.
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.
Currently ignored.
A character vector specifying whether to sort results by “name” or “date”.
A character vector specifying either “asc” or “desc” results order.
An integer specifying the page size of results.
An integer specifying used for pagination.
A logical indicating whether or not to show details of which fields were matched by the query
A logical indicating whether or not to show facets that can be operated on by the fq
parameter
See API documentation.
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")
.
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.
A logical indicating whether to display information about the search query (default is TRUE
).
Currently ignored.
A character string specifying a Dataverse name or an object of class “dataverse”.
A list.
This function provides an interface for searching for Dataverses, datasets, and/or files within a Dataverse server.
if (FALSE) { # \dontrun{
# 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")
} # }