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

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
)

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.

Examples

## simple search for 'state' in any part of the dictionary sc_dict('state')
#> #> --------------------------------------------------------------------- #> varname: stabbr source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> State postcode #> #> VALUES: NA #> #> #> --------------------------------------------------------------------- #> varname: st_fips source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> FIPS code for state #> #> VALUES: #> #> 1 = Alabama #> 2 = Alaska #> 4 = Arizona #> 5 = Arkansas #> 6 = California #> 8 = Colorado #> 9 = Connecticut #> 10 = Delaware #> 11 = District of Columbia #> 12 = Florida #> 13 = Georgia #> 15 = Hawaii #> 16 = Idaho #> 17 = Illinois #> 18 = Indiana #> 19 = Iowa #> 20 = Kansas #> 21 = Kentucky #> 22 = Louisiana #> 23 = Maine #> 24 = Maryland #> 25 = Massachusetts #> 26 = Michigan #> 27 = Minnesota #> 28 = Mississippi #> 29 = Missouri #> 30 = Montana #> 31 = Nebraska #> 32 = Nevada #> 33 = New Hampshire #> 34 = New Jersey #> 35 = New Mexico #> 36 = New York #> 37 = North Carolina #> 38 = North Dakota #> 39 = Ohio #> 40 = Oklahoma #> 41 = Oregon #> 42 = Pennsylvania #> 44 = Rhode Island #> 45 = South Carolina #> 46 = South Dakota #> 47 = Tennessee #> 48 = Texas #> 49 = Utah #> 50 = Vermont #> 51 = Virginia #> 53 = Washington #> 54 = West Virginia #> 55 = Wisconsin #> 56 = Wyoming #> 60 = American Samoa #> 64 = Federated States of Micronesia #> 66 = Guam #> 69 = Northern Mariana Islands #> 70 = Palau #> 72 = Puerto Rico #> 78 = Virgin Islands #> #> #> --------------------------------------------------------------------- #> varname: tuitionfee_in source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> In-state tuition and fees #> #> VALUES: NA #> #> #> --------------------------------------------------------------------- #> varname: tuitionfee_out source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> Out-of-state tuition and fees #> #> VALUES: NA #> #> --------------------------------------------------------------------- #> Printed information for 4 of out 4 variables. #>
## variable names starting with 'st' sc_dict('^st', search_col = 'varname')
#> #> --------------------------------------------------------------------- #> varname: stabbr source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> State postcode #> #> VALUES: NA #> #> #> --------------------------------------------------------------------- #> varname: st_fips source: IPEDS #> --------------------------------------------------------------------- #> DESCRIPTION: #> #> FIPS code for state #> #> VALUES: #> #> 1 = Alabama #> 2 = Alaska #> 4 = Arizona #> 5 = Arkansas #> 6 = California #> 8 = Colorado #> 9 = Connecticut #> 10 = Delaware #> 11 = District of Columbia #> 12 = Florida #> 13 = Georgia #> 15 = Hawaii #> 16 = Idaho #> 17 = Illinois #> 18 = Indiana #> 19 = Iowa #> 20 = Kansas #> 21 = Kentucky #> 22 = Louisiana #> 23 = Maine #> 24 = Maryland #> 25 = Massachusetts #> 26 = Michigan #> 27 = Minnesota #> 28 = Mississippi #> 29 = Missouri #> 30 = Montana #> 31 = Nebraska #> 32 = Nevada #> 33 = New Hampshire #> 34 = New Jersey #> 35 = New Mexico #> 36 = New York #> 37 = North Carolina #> 38 = North Dakota #> 39 = Ohio #> 40 = Oklahoma #> 41 = Oregon #> 42 = Pennsylvania #> 44 = Rhode Island #> 45 = South Carolina #> 46 = South Dakota #> 47 = Tennessee #> 48 = Texas #> 49 = Utah #> 50 = Vermont #> 51 = Virginia #> 53 = Washington #> 54 = West Virginia #> 55 = Wisconsin #> 56 = Wyoming #> 60 = American Samoa #> 64 = Federated States of Micronesia #> 66 = Guam #> 69 = Northern Mariana Islands #> 70 = Palau #> 72 = Puerto Rico #> 78 = Virgin Islands #> #> --------------------------------------------------------------------- #> Printed information for 2 of out 2 variables. #>
## return full dictionary (only recommended if not printing and ## storing in object) df <- sc_dict('.', limit = Inf, print_off = TRUE, return_df = TRUE)