get_var_info {cspp} | R Documentation |
Get information regarding the CSPP variables
Description
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.
Usage
get_var_info(
var_names = NULL,
categories = NULL,
related_to = NULL,
exact = FALSE
)
Arguments
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. |
Details
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.
See Also
get_cspp_data
, get_cites
, generate_map
Examples
# 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")