Skip to contents

Filtering nonprofits.detailed with given search criteria to create comparison set. The EIN's that make it through this filtering will be used to filter nonprofits for final comparison set output.

dat_filtering is mainly used as an internal function in select_sample, but can be used on its own.

Usage

dat_filtering(
  type.org = "RG",
  broad.category = c("ART", "EDU", "ENV", "HEL", "HMS", "IFA", "PSB", "REL", "MMB",
    "UNU", "UNI", "HOS"),
  major.group = base::LETTERS,
  division = NA,
  subdivision = NA,
  univ = FALSE,
  hosp = FALSE,
  location.type = c("urban", "suburban", "town", "rural"),
  state = state.abb52,
  total.expense = c(0, Inf)
)

Format

dat_filtering

Arguments

type.org

vector of the types of organization you want to include. Options are RG, AA, MT, PA, RP, MS, MM, and/or NS.

broad.category

vector of broad categories you wish to include in returned data set Options are ART, EDU, ENV, HEL, HMS, IFA, PSB, REL, MMB, UNU, UNI, and/or HOS

major.group

vector of major groups you wish to include in returned data set. Options are A-Z.

division

vector of divisions you wish to include. Divisions exist entirely inside major groups. We suggest you do not use this parameter if you have more than one item in major.group. Options are 0, 2, 3, ..., 9 (1 is not an option.

subdivision

vector of subdivision you wish to include. Subdivisions exist entirely inside divisions. We suggest you do not use this parameter if you have more than one item in division. Options are 0 - 9.

univ

TRUE of FALSE. Are universities to be included?

hosp

TRUE of FALSE, Are hospitals to be included?

location.type

vector of "metro", "suburban", "town", and/or "rural" for which city types to include

state

vector of 2 letter state abbreviations to be included

total.expense

vector of c(min,max) of range of total expenses to be included

Any parameter you want to include all values for, you can either list all possible values, or assign that parameter to NA. Default parameters are set to include all regular organizations and exclude all specality organizations.

Value

All entries in nonprofits.detailed data set that match the filtering criteria

Examples

# all non-university educational nonprofits in Kansas, Nebraska, Iowa, and Missouri.
dat_filtering(
  type.org = "RG",
  broad.category = "EDU", 
  major.group = "B", 
  univ = FALSE,
  hosp = FALSE, 
  location.type = c("urban", "suburban", "town", "rural"), 
  state = c("KS", "NE", "IA", "MO") ,
  total.expense = c(0, Inf))
#> # A tibble: 14 × 14
#>          EIN ntee  new.code   type.org broad.category major.group division
#>        <dbl> <chr> <chr>      <chr>    <chr>          <chr>       <chr>   
#>  1 420752666 B24   RG-EDU-B24 RG       EDU            B           2       
#>  2 420772563 B25   RG-EDU-B25 RG       EDU            B           2       
#>  3 421087681 B24   RG-EDU-B24 RG       EDU            B           2       
#>  4 237414672 B82   RG-EDU-B82 RG       EDU            B           8       
#>  5 486115644 B8443 RG-EDU-B84 RG       EDU            B           8       
#>  6 480947391 B82   RG-EDU-B82 RG       EDU            B           8       
#>  7 430415670 B20   RG-EDU-B20 RG       EDU            B           2       
#>  8 475359250 B29   RG-EDU-B29 RG       EDU            B           2       
#>  9 237413671 B28   RG-EDU-B28 RG       EDU            B           2       
#> 10 431435729 B60   RG-EDU-B60 RG       EDU            B           6       
#> 11 431817830 B25   RG-EDU-B25 RG       EDU            B           2       
#> 12 431851910 B24   RG-EDU-B24 RG       EDU            B           2       
#> 13 470493447 B99   RG-EDU-B99 RG       EDU            B           9       
#> 14 476032870 B82   RG-EDU-B82 RG       EDU            B           8       
#> # ℹ 7 more variables: subdivision <chr>, univ <lgl>, hosp <lgl>,
#> #   total.expense <dbl>, state <chr>, location.type <chr>, RUCA <dbl>