sc_dict: Search data dictionary.

View source: R/dictionary.R

sc_dictR Documentation

Search data dictionary.

Description

This function is used to search the College Scorecard data dictionary.

Usage

sc_dict(
  search_string,
  search_col = c("all", "description", "varname", "dev_friendly_name", "dev_category",
    "label", "source"),
  ignore_case = TRUE,
  limit = 10,
  confirm = FALSE,
  print_dev = FALSE,
  print_notes = FALSE,
  return_df = FALSE,
  print_off = FALSE,
  can_filter = FALSE,
  filter_vars = FALSE
)

Arguments

search_string

Character string for search. Can use regular expression for search. Must escape special characters, . \ | ( ) [ { ^ $ * + ?, with a doublebackslash \\.

search_col

Column to search. The default is to search all columns. Other options include: "varname", "dev_friendly_name", "dev_category", "label".

ignore_case

Search is case insensitive by default. Change to FALSE to restrict search to exact case matches.

limit

Only the first 10 dictionary items are returned by default. Increase to return more values. Set to Inf to return all items matched in search'

confirm

Use to confirm status of variable name in dictionary. Returns TRUE or FALSE.

print_dev

Set to TRUE if you want to see the developer friendly name and category used in the API call.

print_notes

Set to TRUE if you want to see the notes included in the data dictionary (if any).

return_df

Return a tibble of the subset data dictionary.

print_off

Do not print to console; useful if you only want to return a tibble of dictionary values.

can_filter

Use to confirm that a variable can be used as a filtering variable. Returns TRUE or FALSE

filter_vars

Use to print variables that can be used to filter calls. Use with argument return_df = TRUE to return a tibble of these variables in addition to console output.

Examples

## simple search for 'state' in any part of the dictionary
sc_dict('state')

## variable names starting with 'st'
sc_dict('^st', search_col = 'varname')

## return full dictionary (only recommended if not printing and
## storing in object)
df <- sc_dict('.', limit = Inf, print_off = TRUE, return_df = TRUE)

## print list of variables that can be used to filter
df <- sc_dict('.', filter_vars = TRUE, return_df = TRUE)

btskinner/rscorecard documentation built on March 27, 2024, 12:31 a.m.