get_var_info | R Documentation |
get_var_info
retrieves information regarding variables in the CSPP dataset.
The information available includes: the years each variable is observed in the data;
a short and long description of each variable; the source and citation for each
variable; and a general category that describes each variable.
get_var_info( var_names = NULL, categories = NULL, related_to = NULL, exact = FALSE )
var_names |
Default is NULL. Takes a character string. If left blank the function does not subset by variable name. |
categories |
Default is NULL. Takes a character string. If left blank the function does not subset by category. |
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 and returns either exact or partial matches
depending on the value of the |
exact |
Default is FALSE. If true, exact matches for the other supplied arguments are used. If TRUE, then partial matches are also returned. |
Users can request this information regarding specific variables or all the variables
within a specific category. Users can request exact matches of their supplied arguments
or allow partial matches with the exact
argument. Users can also search all these
relevant fields (variable name, short/long description, source) for a keyword/s with the
supply a string related_to
argument to identify variables related to a topic of interest.
Specifying no arguments returns all the information for all the variables in the CSPP dataset.
get_cspp_data
, get_cites
, generate_map
# returns all variable information get_var_info() # searches all columns for non-exact matches of "pop" and "fem" get_var_info(related_to = c("pop","femal")) get_var_info(categories = "demographics") # returns non-exact matches for variables with "pop" and that have "femal" anywhere in the row get_var_info(var_names = "pop", related_to = "femal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.