View source: R/search_datasets.R
search_datasets | R Documentation |
Identify relevant datasets using a keyword or a custom query.
If the query
is a character string, then all character columns in the table
are searched and the entries for which at least one
partial match was found are returned. Alternatively, a named list can be
used to look for an exact match in a specific column (see Details section).
search_datasets(query, verbose = TRUE, ...)
query |
either a character string including a single keyword or a named list containing a custom query (see details section below). Note that if an empty character string is passed, then all datasets available are returned. |
verbose |
a logical. Should extra information be reported on progress? |
... |
further arguments to be passed to |
If query
is a named list, the name used should be one of the following:
id: unique identifier of the dataset
name: name of the dataset
date: date (YYYY-mm-dd
) of the corresponding publication
description: a brief description of the data set
ref_id: the Mangal identifier of the dataset
Note that for lists with more than one element, only the first element is used, the others are ignored. Examples covering custom queries are provided below.
An object of class mgSearchDatasets
, which basically is a data.frame
object including all datasets corresponding to the query. For each dataset
entry, the networks and the original reference are attached.
# Return all datasets (takes time)
all_datasets <- search_datasets("")
all_datasets
class(all_datasets)
# Search with keyword
mg_lagoon <- search_datasets(query = 'lagoon')
# Search with a custom query (specific column)
mg_kemp <- search_datasets(query = list(name = 'kemp_1977'))
mg_16 <- search_datasets(query = list(ref_id = 16))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.