get_var_info | R Documentation |
get_var_info
retrieves information regarding variables in the CongressData dataset.
The information available includes: the years each variable is observed in the data;
a short and long description of each variable; and the source and citation/s for each
variable. Citations are available in both bibtex and plain text.
get_var_info(var_names = NULL, related_to = NULL)
var_names |
Default is NULL. Takes a character string. If left blank the function does not subset by variable name. Note that this searches variable names, it does not subset by the specific string you provide. So "over65" will return a variable called 'over65' along with another called 'percent_over65'. |
related_to |
Default is NULL. Takes a character string. If the user supplies a character string, the function searches the other relevant fields (variable name, short/long description, and source) for string matches. Not case sensitive. |
Specifying no arguments returns all the information for all the variables in the CongressData dataset.
A tibble with information about variables in the CongressData dataset. The tibble contains the following columns:
variable
: The name of the variable.
years
: The years the variable is observed.
short_desc
: A short description of the variable.
long_desc
: A long description of the variable.
source
: The source of the data.
citation
: The citation for the data, available in bibtex and plain text.
The tibble is filtered based on the provided var_names
and related_to
parameters.
# returns all variable information
get_var_info()
# match var names that contain "over65" - note this returns multiple variables
get_var_info(var_names = "over65")
get_var_info(related_to = c("pop","femal"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.