find_id searches for survey names that match argument pattern.
All arguments but first are passed to grepl for
pattern matching.
find_id(pattern, first = TRUE, ignore.case = TRUE, perl = TRUE, fixed = FALSE)
| pattern | Character string containing a regular expression (or character
string for |
|---|---|
| first | Whether to return only the first match (default) or all matches. See Details. |
| ignore.case | if |
| perl | logical. Should Perl-compatible regexps be used? |
| fixed | logical. If |
A named character vector giving the id(s) of matching surveys, or an empty character vector if there are no matches.
find_id retrieves the names and ids of all available surveys (using
surveys), and then uses grepl to search the
names for matches.
For first = TRUE (the default), only the id of the first matching name
(if any) is returned. Matches are sorted by lastModified timestamp
(descending), so first = TRUE gives the id of the matching survey most
recently modified.
# NOT RUN { find_id("demographics") # }