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).
Arguments
- 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
httr::GET()
.
Value
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.
Details
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 publicationdescription: 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.
Examples
# \donttest{
# Return all datasets (takes time)
all_datasets <- search_datasets("")
#> Data retrieval 50%
#> Data retrieval 100%
#>
#> Found 175 datasets
#> Data retrieval 100%
#>
#> Processing id: 2 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 7 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 9 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 14 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 15 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 16 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 17 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 18 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 19 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 20 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 21 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 22 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 23 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 24 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 25 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 26 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 27 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 28 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 29 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 30 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 31 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 32 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 33 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 34 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 35 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 38 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 39 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 40 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 41 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 42 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 44 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 45 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 46 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 47 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 48 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 49 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 50 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 51 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 52 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 53 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 54 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 55 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 37 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 56 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 36 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 57 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 1 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 3 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 5 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 4 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 8 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 10 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 11 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 12 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 13 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 58 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 59 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 60 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 110 1/1
#>
#> Data retrieval 12.5%
#> Data retrieval 25%
#> Data retrieval 37.5%
#> Data retrieval 50%
#> Data retrieval 62.5%
#> Data retrieval 75%
#> Data retrieval 87.5%
#> Data retrieval 100%
#>
#> Processing id: 6 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 61 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 62 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 63 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 64 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 65 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 66 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 67 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 68 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 69 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 70 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 71 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 72 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 73 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 74 1/1
#>
#> Data retrieval 50%
#> Data retrieval 100%
#>
#> Processing id: 75 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 76 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 77 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 78 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 79 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 80 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 81 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 82 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 83 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 84 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 85 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 86 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 87 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 88 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 89 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 90 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 91 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 92 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 93 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 94 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 95 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 96 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 97 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 98 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 99 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 100 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 101 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 102 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 103 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 104 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 105 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 106 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 107 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 108 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 109 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 111 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 112 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 113 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 114 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 115 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 116 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 118 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 117 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 120 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 121 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 122 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 123 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 125 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 126 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 127 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 128 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 129 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 130 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 131 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 132 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 133 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 134 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 135 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 136 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 137 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 138 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 139 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 140 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 141 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 142 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 143 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 144 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 145 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 146 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 147 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 148 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 149 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 150 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 151 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 152 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 153 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 154 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 155 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 156 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 157 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 158 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 159 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 160 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 161 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 162 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 163 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 164 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 165 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 166 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 167 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 168 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 169 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 170 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 171 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 172 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 173 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 174 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 175 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 176 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 177 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 178 1/1
#>
all_datasets
#> # A tibble: 175 × 10
#> id name description public created_at updated_at ref_id user_id
#> <int> <chr> <chr> <lgl> <chr> <chr> <int> <int>
#> 1 2 howking_1968 Insect act… TRUE 2019-02-2… 2019-02-2… 2 2
#> 2 7 lundgren_olese… Pollnator … TRUE 2019-02-2… 2019-02-2… 7 2
#> 3 9 elberling_oles… Flower-vis… TRUE 2019-02-2… 2019-02-2… 9 2
#> 4 14 johnston_1956 Predation … TRUE 2019-02-2… 2019-02-2… 14 3
#> 5 15 havens_1992 Pelagic co… TRUE 2019-02-2… 2019-02-2… 15 3
#> 6 16 kemp_1977 Food web f… TRUE 2019-02-2… 2019-02-2… 16 3
#> 7 17 bradstreet_1982 Food web o… TRUE 2019-02-2… 2019-02-2… 17 3
#> 8 18 patten_1979 Food web o… TRUE 2019-02-2… 2019-02-2… 18 3
#> 9 19 clarke_1967 Food web o… TRUE 2019-02-2… 2019-02-2… 19 3
#> 10 20 van_es_1967 Food web o… TRUE 2019-02-2… 2019-02-2… 20 3
#> # ℹ 165 more rows
#> # ℹ 2 more variables: references <list>, networks <list>
class(all_datasets)
#> [1] "tbl_df" "tbl" "data.frame" "mgSearchDatasets"
# Search with keyword
mg_lagoon <- search_datasets(query = 'lagoon')
#> Data retrieval 100%
#>
#> Found 2 datasets
#> Data retrieval 100%
#>
#> Processing id: 22 1/1
#>
#> Data retrieval 100%
#>
#> Processing id: 53 1/1
#>
# Search with a custom query (specific column)
mg_kemp <- search_datasets(query = list(name = 'kemp_1977'))
#> Data retrieval 100%
#>
#> Found 1 datasets
#> Data retrieval 100%
#>
#> Processing id: 16 1/1
#>
mg_16 <- search_datasets(query = list(ref_id = 16))
#> Data retrieval 100%
#>
#> Found 1 datasets
#> Data retrieval 100%
#>
#> Processing id: 16 1/1
#>
# }