Description Usage Arguments Details Examples
Uses data.frame subsetting along with grepl to return all rows in
scb_cache
that matches the provided arguments. Arguments that
are skipped are ignored. The function uses data/scb_cache.rda by default, but
this can be overriden via the cached_database argument.
1 2 3 |
search_id |
Directory or table ID path |
search_type |
"l" for directory, "t" for table |
search_name |
Regex for directory or table name |
search_var_desc |
Rexeg for variable descriptions: table only |
search_val_desc |
Regex for value descriptions: table only |
search_year |
Year for which there is data: table only |
cached_database |
See |
ignore_case |
Is regex case sensitive - passed to grepl |
The subsetting starts with the type argument, to quickly separate databases
and tables; this is done as a simple data.frame subsetting operation,
matching either "l" or "t". The function then goes through the rest of the
arguments, and uses grepl
to match the string or regex
provided in the relevant column.
If type is not specified but any search term other than ID is, the function will default to table search as the other search variables are only present in tables. In this case, a warning is provided.
This function is subject to change as the caching function is improved.
1 2 3 4 5 6 | ## Not run:
scb_search(search_id = "AM/AM0101")
scb_search(search_type = "t", search_name = "LFS", ignore_case = TRUE)
scb_search(search_type = "t", search_var_desc = "overtime")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.