data-raw/irs_dicts.R

z <-
  "PC\tA public charity.\t50% (60% for cash contributions)\nPOF\tA private operating foundation.\t50% (60% for cash contributions)\nPF\tA private foundation.\t30% (generally)\nGROUP\tGenerally, a central organization holding a group exemption letter, whose subordinate units covered by the group exemption are also eligible to receive tax-deductible contributions, even though they are not separately listed.\tDepends on various factors\nLODGE\tA domestic fraternal society, operating under the lodge system, but only if the contribution is to be used exclusively for charitable purposes.\t30%\nUNKWN\tA charitable organization whose public charity status has not been determined.\tDepends on various factors\nEO\tAn organization described in section 170(c) of the Internal Revenue Code other than a public charity or private foundation.\tDepends on various factors\nFORGN\tA foreign-addressed organization. These are generally organizations formed in the United States that conduct activities in foreign countries. Certain foreign organizations that receive charitable contributions deductible pursuant to treaty are also included, as are organizations created in U.S. possessions.\tDepends on various factors\nSO\tA Type I, Type II, or functionally integrated Type III supporting organization.\t50% (60% for cash contributions)\nSONFI\tA non-functionally integrated Type III supporting organization.\t50% (60% for cash contributions)\nSOUNK\tA supporting organization, unspecified type.\t50% (60% for cash contributions)"

# deduct ------------------------------------------------------------------


tbl_types_deduct <-
  read_tsv(z, col_names = F) %>% setNames(c(
    "codeDeductibility",
    "typeCharity",
    "descriptionDeductibility"
  ))

dictionary_irs_tax_deductibilty_codes <- tbl_types_deduct %>%
  munge_data() %>%
  mutate(
    pctDeductibilityBasic = case_when(
      descriptionDeductibility %>% str_detect("50%") ~ .5,
      descriptionDeductibility %>% str_detect("30%") ~ .3,
      descriptionDeductibility %>% str_detect("30%") ~ NA_real_
    ),
    pctDeductibilityCash =  case_when(
      descriptionDeductibility %>% str_detect("60%") ~ .6,
      descriptionDeductibility %>% str_detect("30%") ~ .3,
      descriptionDeductibility %>% str_detect("30%") ~ NA_real_
    )
  )

usethis::use_data(dictionary_irs_tax_deductibilty_codes)




# foundation_codes --------------------------------------------------------



foundation_codes <-
  "
  00 All organizations except 501(c)3)
  02 Private operating foundation exempt from paying excise taxes on investment income
  03 Private operating foundation (other)
  04 Private non-operating foundation
  09 Suspense
  10 Church 170(b)(1)(A)(i)
11 School 170(b)(1)(A)(ii)
12 Hospital or medical research organization 170(b)(1)(A)(iii)
13 Organization which operates for benefit of college or university and is owned or operated by a governmental unit 170(b)(1)(A)(iv)
14 Governmental unit 170(b)(1)(A)(v)
15 Organization which receives a substantial part of its support from a governmental unit or the general public 170(b)(1)(A)(vi)
16 Organization that normally receives no more than one-third of its support from gross investment income and unrelated business income and at the same time more than one-third of its support from contributions, fees, and gross receipts related to exempt purposes. 509(a)(2)
17 Organizations operated solely for the benefit of and in conjunction with organizations described in 10 through
16 above. 509(a)(3)
18 Organization organized and operated to test for public safety 509(a)(4)
21 509(a)(3) Type I
22 509(a)(3) Type II
23 509(a)(3) Type III functionally integrated
24 509(a)(3) Type III not functionally integrated
"

dictionary_irs_foundation_types <-
  .block_text_to_dict(x = foundation_codes,
                      column_names = c("codeFoundation", "typeFoundation"))

usethis::use_data(dictionary_irs_foundation_types)


# dictionary_irs_organization_types ---------------------------------------



org_codes <-
  "
  1 Corporation
  2 Trust
  3 Co-operative
  4 Partnership
  5 Association
"

dictionary_irs_organization_types <-
  .block_text_to_dict(x = org_codes, c("idOrganization", "typeOrganization")) %>%
  mutate(idOrganization = as.numeric(idOrganization))

usethis::use_data(dictionary_irs_organization_types)


# dictionary_irs_status_exemptions ----------------------------------------


exempt_codes <- "
01 Unconditional Exemption
02 Conditional Exemption
12 Trust described in section 4947(a)(2) of the IR Code
25 Organization terminating its private foundation status under section 507(b)(1)(B) of the Code
"

dictionary_irs_status_exemptions <-
  .block_text_to_dict(x = exempt_codes, c("codeExemptionStatus", "typeExemptionStatus"))

usethis::use_data(dictionary_irs_status_exemptions)



# asset_income_codes ------------------------------------------------------


asset_income_codes <-
  "
0 0
1 1 to 9,999
2 10,000 to 24,999
3 25,000 to 99,999
4 100,000 to 499,999
5 500,000 to 999,999
6 1,000,000 to 4,999,999
7 5,000,000 to 9,999,999
8 10,000,000 to 49,999,999
9 50,000,000 to greater
"
dictionary_irs_asset_codes <-
  .block_text_to_dict(x = asset_income_codes, c("idAssetAmount", "rangeAssetAmount")) %>%
  mutate(idAssetAmount  = idAssetAmount %>% as.numeric()) %>%
  mutate(rangeAssetAmount = rangeAssetAmount %>% str_replace_all("TO", "to"))

usethis::use_data(dictionary_irs_asset_codes)

dictionary_irs_income_codes <-
  .block_text_to_dict(x = asset_income_codes, c("idIncomeAmount", "rangeIncomeAmount")) %>%
  mutate(idIncomeAmount  = idIncomeAmount %>% as.numeric()) %>%
  mutate(rangeIncomeAmount = rangeIncomeAmount %>% str_replace_all("TO", "to"))

usethis::use_data(dictionary_irs_income_codes)

# filing_requirement_codes ------------------------------------------------


filing_requirement_codes <- "
01 990 - all other or 990EZ return
02 990 - Required to file Form 990-N|Income less than $25,000 per year
03 990 - Group return
04 990 - Required to file Form 990-BL|Black Lung Trusts
06 990 - Not required to file|church
07 990 - Government 501(c)(1)
13 990 - Not required to file|religious
14 990 - Not required to file|instrumentalities of states or political subdivisions
00 990 - Not required to file|all other
"

dictionary_irs_filing_requirements <-
  .block_text_to_dict(x = filing_requirement_codes, c("codeFilingRequirement", "formType")) %>%
  separate(formType,
           sep = "\\ - ",
           into = c("codeForm", "typeFilingRequirement")) %>%
  separate(
    typeFilingRequirement,
    into = c("typeFilingRequirement", "descriptionExemption"),
    sep = "\\|",
    extra = 'merge',
    fill = 'right'
  )

usethis::use_data(dictionary_irs_filing_requirements)


# irs_class ---------------------------------------------------------------


activity_codes <- "
  Religious Activities
001 Church, synagogue, etc
002 Association or convention of churches
003 Religious order
004 Church auxiliary
005 Mission
006 Missionary activities
007 Evangelism
008 Religious publishing activities
029 Other religious activities
Schools, Colleges and Related Activities
030 School, college, trade school, etc.
031 Special school for the blind, handicapped, etc
032 Nursery school
033 Faculty group
034 Alumni association or group
035 Parent or parent-teachers association
036 Fraternity or sorority
037 Other student society or group
038 School or college athletic association
039 Scholarships for children of employees
040 Scholarships, Other
041 Student loans
042 Student housing activities
043 Other student aid
044 Student exchange with foreign country
045 Student operated business
046 Private school
059 Other school related activities
Cultural, Historical of Other Educational Activities
060 Museum, zoo, planetarium, etc.
061 Library
062 Historical site, records or reenactment
063 Monument
064 Commemorative event
065 Fair
088 Community theatrical group
089 Singing society or group
090 Cultural performances
091 Art exhibit
092 Literary activities
093 Cultural exchanges with foreign country
094 Genealogical activities
119 Other cultural or historical activities
Other Instructions and Training Activities
120 Publishing activities
121 Radio or television broadcasting
122 Producing films
123 Discussion groups, forums, panels lectures, etc.
124 Study and research, Non-scientific
125 Giving information or opinion
126 Apprentice training
149 Other instruction and training
Health Services and Related Activities
150 Hospital
151 Hospital auxiliary
152 Nursing or convalescent home
153 Care and housing for the aged
154 Health clinic
155 Rural medical facility
156 Blood bank
157 Cooperative hospital service organization
158 Rescue and emergency service
159 Nurses register or bureau
160 Aid to the handicapped
161 Scientific disease research
162 Other medical research
163 Health insurance
164 Prepared group health plan
165 Community health planning
166 Mental health care
167 Group medical practice association
168 In-faculty group practice association
169 Hospital pharmacy, parking facility, food services, etc.
179 Other health services
Scientific Research Activities
180 Contact or sponsored scientific research for industry
181 Scientific research for government
199 Other scientific research activities
Business and Professional Organizations
200 Business promotion
201 Real estate association
202 Board of trade
203 Regulating business
204 Promotion of fair business practices
205 Professional association
206 Professional association auxiliary
207 Industry trade shows
208 Convention displays
209 Research, development and testing
210 Professional athletic league
211 Underwriting municipal insurance
212 Assigned risk insurance activities
213 Tourist bureau
229 Other business or professional group
Farming and Related Activities
230 Farming
231 Farm bureau
232 Agricultural group
233 Horticultural group
234 Farmers cooperative marketing or purchasing
235 Farmers cooperative marketing or purchasing
236 Dairy herd improvement association
237 Breeders association
249 Other farming and related activities
Mutual Organizations
250 Mutual ditch, irrigation, telephone, electric company or like organization
251 Credit union
252 Reserve funds or insurance for domestic building and loan association, cooperative bank, or mutual savings bank
253 Mutual insurance company
254 Corporation organized under an Act of Congress
259 Other mutual organization
Employee of Membership Benefit Organizations
260 Fraternal Beneficiary society, order, or association
261 Improvement of conditions of workers
262 Association of municipal employees
263 Association of employees
264 Employee or member welfare association
265 Sick, accident, death, or similar benefits
266 Strike benefits
267 Unemployment benefits
268 Pension or retirement benefits
269 Vacation benefits
279 Other services or benefits to members or employees
Sports, Athletic Recreational and Social Activities
280 Country club
281 Hobby club
282 Dinner club
283 Variety club
284 Dog club
285 Women's club
286 Hunting or fishing club
287 Swimming or tennis club
288 Other sports club
296 Community center
297 Community recreational facilities
298 Training in sports
299 Travel tours
300 Amateur athletic association
301 Fundraising athletic or sports event
317 Other sports or athletic activities
318 Other recreational activities
319 Other social activities
Youth Activities
320 Boy Scouts, Girl Scouts, etc.
321 Boys Club, Little League, etc.
322 FFA, FHA, 4-H club, etc.
323 Key club
324 YMCA, YWCA, YMCA, etc.
325 Camp
326 Care and housing of children
327 Prevention of cruelty to children
328 Combat juvenile delinquency
349 Other youth organization or activities
Conservation, Environmental and Beautification Activities
350 Preservation of natural resources
351 Combating or preventing pollution
352 Land acquisition for preservation
353 Soil or water conservation
354 Preservation of scenic beauty
355 Wildlife sanctuary or refuge
356 Garden club
379 Other conservation, environmental or beautification activities
Housing Activities
380 Low-income housing
381 Low and moderate income housing
382 Housing for the aged
398 Instruction and guidance on housing
399 Other housing activities
Inner City or Community Activities
400 Area development, redevelopment of renewal
401 Homeowners association
402 Other activity aimed t combating community deterioration
403 Attracting new industry or retaining industry in an area
404 Community promotion
405 Loans or grants for minority businesses
406 Crime prevention
407 Voluntary firemen's organization or auxiliary
408 Community service organization
429 Other inner city or community benefit activities
Civil Rights Activities
430 Defense of human and civil rights
431 Elimination of prejudice and discrimination
432 Lessen neighborhood tensions
449 Other civil rights activities
Litigation and Legal Aid Activities
460 Public interest litigation activities
461 Other litigation or support of litigation
462 Legal aid to indigents
463 Providing bail
465 Plan under IRC section 120
Legislative and Political Activities
480 Propose, support, or oppose legislation
481 Voter information on issues or candidates
482 Voter education
483 Support, oppose, or rate political candidates
484 Provide facilities or services for political campaign activities
509 Other legislative and political activities
Advocacy Attempt to influence public opinion concerning:
510 Firearms control
511 Selective Service System
512 National defense policy
513 Weapons systems
514 Government spending
515 Taxes or tax exemption
516 Separation of church and state
517 Government aid to parochial schools
518 U.S. foreign policy
519 U.S. military involvement
520 Pacifism and peace
521 Economic-political system of U.S.
522 Anti-communism
523 Right to work
524 Zoning or rezoning
525 Location of highway or transportation system
526 Rights of criminal defendants
527 Capital punishment
528 Stricter law enforcement
529 Ecology or conservation
530 Protection of consumer interests
531 Medical care service
532 Welfare systems
533 Urban renewal
534 Busing student to achieve racial balance
535 Racial integration
536 Use of intoxicating beverage
537 Use of drugs or narcotics
538 Use of tobacco
539 Prohibition of erotica
540 Sex education in public schools
541 Population control
542 Birth control methods
543 Legalized abortion
559 Other matters
Other Activities Directed to Individuals
560 Supplying money, goods or services to the poor
561 Gifts or grants to individuals , other than scholarships
562 Other loans to individuals
563 Marriage counseling
564 Family planning
565 Credit counseling and assistance
566 Job training, counseling, or assistance
567 Draft counseling
568 Vocational counseling
569 Referral service, social agencies
572 Rehabilitating convicts or ex-convicts
573 Rehabilitating alcoholics, drug abusers, compulsive gamblers, etc.
574 Day care center
575 Services for the aged
Activities Purposes and Activities
600 Community Chest, United Way, etc.
601 Booster club
602 Gifts, grants, or loans to other organizations
603 Non-financial services of facilities to other organizations
Other Purposes and Activities
900 Cemetery or burial activities
901 Perpetual Care Fund
902 Emergency or disaster aid fund
903 Community trust or component
904 Government instrumentality or agency
905 Testing products for public safety
906 Consumer interest group
907 Veterans activities
908 Patriotic activities
909 Non-exempt charitable trust described in section 4947(a)(1) of the Code
910 Domestic organization with activities outside U.S.
911 Foreign organization
912 Title holding corporation
913 Prevention of cruelty to animals
914 Achievement pries of awards
915 Erection or maintenance of public building or works
916 Cafeteria, restaurant, snack bar, food services, etc.
917 Thrift ship, retail outlet, etc.
918 Book, gift or supply store
919 Advertising
920 Association of employees
921 Loans or credit reporting
922 Endowment fund or financial services
923 Indians
924 Traffic or tariff bureau
925 Section 501(c)(1) with 50% deductibility
926 Government instrumentality other than section 501(c)
927 Fundraising
928 4947(a)(2) trust
930 Prepaid legal services pan exempt under IRC section 501(c)(20)
931 Withdrawal liability payment fund
990 Section 501(k) child care organization
994 Described in section 170(b)1)(a)(vi) of the Code
995 Described in section 509(a)(2) of the Code
998 'Unspecified'
"

activity_codes <-
  activity_codes %>% str_split("\n") %>% flatten_chr() %>%
  discard(list(function(x) {
    x == ""
  })) %>%
  str_squish()

dictionary_irs_activity_codes <-
  tibble(activity_codes) %>%
  mutate(id = 1:n()) %>%
  mutate(is_parent = !activity_codes %>% str_detect('[0-9]'))

tbl_parents <-
  dictionary_irs_activity_codes %>% filter(is_parent) %>%
  select(id, nameActivityParent = activity_codes) %>%
  mutate(id = id + 1)

dictionary_irs_activity_codes <-
  dictionary_irs_activity_codes %>%
  filter(!is_parent) %>%
  rename(nameActivityID = activity_codes) %>%
  select(id, nameActivityID) %>%
  mutate(nameActivityID = nameActivityID %>% str_replace("\\ ", "\\|")) %>%
  separate(nameActivityID,
           into = c("codeActivity", "nameActivity"),
           sep = "\\|") %>%
  mutate_if(is.character, str_squish) %>%
  left_join(tbl_parents, by = "id") %>%
  select(nameActivityParent, codeActivity, nameActivity) %>%
  fill(nameActivityParent) %>%
  mutate_if(is.character, str_to_upper)


usethis::use_data(dictionary_irs_activity_codes, overwrite = T)

classification_codes <- "
 01 1 Government Instrumentality
 02 1 Title-Holding Corporation
 03 1 Charitable Organization
 03 2 Educational Organization
 03 3 Literary Organization
 03 4 Organization to Prevent Cruelty to Animals
 03 5 Organization to Prevent Cruelty to Children
 03 6 Organization for Public Safety Testing
 03 7 Religious Organization
 03 8 Scientific Organization
 04 1 Civic League
 04 2 Local Association of Employees
 04 3 Social Welfare Organization
 05 1 Agricultural Organization
 05 2 Horticultural Organization
 05 3 Labor Organization
 06 1 Board of Trade
 06 2 Business League
 06 3 Chamber of Commerce
 06 4 Real Estate Board
 07 1 Pleasure, Recreational, or Social Club
 08 1 Fraternal Beneficiary Society, Order or Association
 09 1 Voluntary Employees' Beneficiary Association (Non-Govt. Emps.)
 09 2 Voluntary Employees' Beneficiary Association (Govt. Emps.)
 10 1 Domestic Fraternal Societies and Associations
 11 1 Teachers Retirement Fund Assoc.
 12 1 Benevolent Life Insurance Assoc.
 12 2 Mutual Ditch or Irrigation Co.
 12 3 Mutual Cooperative Telephone Co.
 12 4 Organization Like Those on Three Preceding Lines
 13 1 Burial Association
 13 2 Cemetery Company
 14 1 Credit Union
 14 2 Other Mutual Corp. or Assoc.
 15 1 Mutual Insurance Company or Assoc. Other Than Life or Marine
 16 1 Corp. Financing Crop Operations
 17 1 Supplemental Unemployment Compensation Trust or Plan
 18 1 Employee Funded Pension Trust (Created Before 6/25/59)
 19 1 Post or Organization of War Veterans
 20 1 Legal Service Organization
 21 1 Black Lung Trust
 22 1 Multiemployer Pension Plan
 23 1 Veterans Assoc. Formed Prior to 1880
 24 1 Trust Described in Sect. 4049 of ERISA
 25 1 Title Holding Co. for Pensions, etc.
 26 1 State-Sponsored High Risk Health Insurance Organizations
 27 1 State-Sponsored Workers' Compensation Reinsurance
 29 1 ACA 1322 Qualified Nonprofit Health Insurance Issuers
 40 1 Apostolic and Religious Org. (501(d))
 50 1 Cooperative Hospital Service Organization (501(e))
 60 1 Cooperative Service Organization of Operating Educational Organization (501(f))
 70 1 Child Care Organization (501(k))
 71 1 Charitable Risk Pool
 81 1 Qualified State-Sponsored Tuition Program
 92 1 4947(a)(1) - Private Foundation (Form 990PF Filer)
"

classification_codes <-
  classification_codes %>% str_split("\n") %>% flatten_chr() %>%
  discard(list(function(x) {
    x == ""
  })) %>%
  str_squish()

dictionary_irs_classification_codes <-
  tibble(classification_codes) %>%
  mutate(classification_codes = classification_codes %>% str_replace("\\ ", "\\|")) %>%
  separate(
    classification_codes,
    into = c("codeClassification", "idCodeName"),
    sep = "\\|"
  ) %>%
  mutate(idCodeName = idCodeName %>% str_replace("\\ ", "\\|")) %>%
  separate(
    idCodeName,
    into = c("numberClassification", "nameClassification"),
    sep = "\\|"
  ) %>%
  mutate_if(is.character, list(function(x) {
    x %>% str_to_upper()
  })) %>%
  mutate_if(is.character, str_squish)

usethis::use_data(dictionary_irs_classification_codes, overwrite = T)

# nte ---------------------------------------------------------------------



nte_primary_codes <- "
A Arts, Culture and Humanities
B Educational Institutions and Related Activities
C Environmental Quality, Protection and Beautification
D Animal-Related
E Health – General and Rehabilitative
F Mental Health, Crisis Intervention
G Diseases, Disorders, Medical Disciplines
H Medical Research
I Crime, Legal-Related
J Employment, Job-Related
K Food, Agriculture and Nutrition
L Housing, Shelter
M Public Safety, Disaster Preparedness and Relief
N Recreation, Sports, Leisure, Athletics
O Youth Development
P Human Services – Multipurpose and Other
Q International, Foreign Affairs and National Security
R Civil Rights, Social Action, Advocacy
S Community Improvement, Capacity Building
T Philanthropy, Voluntarism and Grantmaking Foundations
U Science and Technology Research Institutes, Services
V Social Science Research Institutes, Services
W Public, Society Benefit – Multipurpose and Other
X Religion-Related, Spiritual Development
Y Mutual/Membership Benefit Organizations, Other
Z Unknown
"

dictionary_irs_ntee_parents <-
  .block_text_to_dict(x = nte_primary_codes,
                      c("codeNTEEParent",
                        "nameNTEEParent"))

usethis::use_data(dictionary_irs_ntee_parents, overwrite = T)

nte_detailed_codes <-
  "
 A01 Alliance/Advocacy Organizations
 A02 Management & Technical Assistance
 A03 Professional Societies, Associations
 A05 Research Institutes and/or Public Policy Analysis
 A11 Single Organization Support
 A12 Fund Raising and/or Fund Distribution
 A19 Nonmonetary Support N.E.C.*
 A20 Arts, Cultural Organizations - Multipurpose
 A23 Cultural, Ethnic Awareness
 A25 Arts Education
 A26 Arts Council/Agency
 A30 Media, Communications Organizations
 A31 Film, Video
 A32 Television
 A33 Printing, Publishing
 A34 Radio
 A40 Visual Arts Organizations
 A50 Museum, Museum Activities
 A51 Art Museums
 A52 Children's Museums
 A54 History Museums
 A56 Natural History, Natural Science Museums
 A57 Science and Technology Museums
 A60 Performing Arts Organizations
 A61 Performing Arts Centers
 A62 Dance
 A63 Ballet
 A65 Theater
 A68 Music
 A69 Symphony Orchestras
 A6A Opera
 A6B Singing, Choral
 A6C Music Groups, Bands, Ensembles
 A6E Performing Arts Schools
 A70 Humanities Organizations
 A80 Historical Societies, Related Historical Activities
 A84 Commemorative Events
 A90 Arts Service Organizations and Activities
 A99 Arts, Culture, and Humanities N.E.C.
 B01 Alliance/Advocacy Organizations
 B02 Management & Technical Assistance
 B03 Professional Societies, Associations
 B05 Research Institutes and/or Public Policy Analysis
 B11 Single Organization Support
 B12 Fund Raising and/or Fund Distribution
 B19 Nonmonetary Support N.E.C.
 B20 Elementary, Secondary Education, K - 12
 B21 Kindergarten, Preschool, Nursery School, Early Admissions
 B24 Primary, Elementary Schools
 B25 Secondary, High School
 B28 Specialized Education Institutions
 B30 Vocational, Technical Schools
 B40 Higher Education Institutions
 B41 Community or Junior Colleges
 B42 Undergraduate College (4-year)
 B43 University or Technological Institute
 B50 Graduate, Professional Schools (Separate Entities)
 B60 Adult, Continuing Education
 B70 Libraries
 B80 Student Services, Organizations of Students
 B82 Scholarships, Student Financial Aid Services, Awards
 B83 Student Sororities, Fraternities
 B84 Alumni Associations
 B90 Educational Services and Schools - Other
 B92 Remedial Reading, Reading Encouragement
 B94 Parent/Teacher Group
 B99 Education N.E.C.
 C01 Alliance/Advocacy Organizations
 C02 Management & Technical Assistance
 C03 Professional Societies, Associations
 C05 Research Institutes and/or Public Policy Analysis
 C11 Single Organization Support
 C12 Fund Raising and/or Fund Distribution
 C19 Nonmonetary Support N.E.C.
 C20 Pollution Abatement and Control Services
 C27 Recycling Programs
 C30 Natural Resources Conservation and Protection
 C32 Water Resource, Wetlands Conservation and Management
 C34 Land Resources Conservation
 C35 Energy Resources Conservation and Development
 C36 Forest Conservation
 C40 Botanical, Horticultural, and Landscape Services
 C41 Botanical Gardens, Arboreta and Botanical Organizations
 C42 Garden Club, Horticultural Program
 C50 Environmental Beautification and Aesthetics
 C60 Environmental Education and Outdoor Survival Programs
 C99 Environmental Quality, Protection, and Beautification N.E.C.
 D01 Alliance/Advocacy Organizations
 D02 Management & Technical Assistance
 D03 Professional Societies, Associations
 D05 Research Institutes and/or Public Policy Analysis
 D11 Single Organization Support
 D12 Fund Raising and/or Fund Distribution
 D19 Nonmonetary Support N.E.C.
 D20 Animal Protection and Welfare
 D30 Wildlife Preservation, Protection
 D31 Protection of Endangered Species
 D32 Bird Sanctuary, Preserve
 D33 Fisheries Resources
 D34 Wildlife Sanctuary, Refuge
 D40 Veterinary Services
 D50 Zoo, Zoological Society
 D60 Other Services - Specialty Animals
 D61 Animal Training, Behavior
 D99 Animal-Related N.E.C.
 E01 Alliance/Advocacy Organizations
 E02 Management & Technical Assistance
 E03 Professional Societies, Associations
 E05 Research Institutes and/or Public Policy Analysis
 E11 Single Organization Support
 E12 Fund Raising and/or Fund Distribution
 E19 Nonmonetary Support N.E.C.
 E20 Hospitals and Related Primary Medical Care Facilities
 E21 Community Health Systems
 E22 Hospital, General
 E24 Hospital, Specialty
 E30 Health Treatment Facilities, Primarily Outpatient
 E31 Group Health Practice (Health Maintenance Organizations)
 E32 Ambulatory Health Center, Community Clinic
 E40 Reproductive Health Care Facilities and Allied Services
 E42 Family Planning Centers
 E50 Rehabilitative Medical Services
 E60 Health Support Services
 E61 Blood Supply Related
 E62 Ambulance, Emergency Medical Transport Services
 E65 Organ and Tissue Banks
 E70 Public Health Program (Includes General Health and Wellness Promotion
 Services)
 E80 Health, General and Financing
 E86 Patient Services - Entertainment, Recreation
 E90 Nursing Services (General)
 E91 Nursing, Convalescent Facilities
 E92 Home Health Care
 E99 Health - General and Rehabilitative N.E.C.
 F01 Alliance/Advocacy Organizations
 F02 Management & Technical Assistance
 F03 Professional Societies, Associations
 F05 Research Institutes and/or Public Policy Analysis
 F11 Single Organization Support
 F12 Fund Raising and/or Fund Distribution
 F19 Nonmonetary Support N.E.C.
 F20 Alcohol, Drug and Substance Abuse, Dependency Prevention and
 Treatment
 F21 Alcohol, Drug Abuse, Prevention Only
 F22 Alcohol, Drug Abuse, Treatment Only
 F30 Mental Health Treatment - Multipurpose and N.E.C.
 F31 Psychiatric, Mental Health Hospital
 F32 Community Mental Health Center
 F33 Group Home, Residential Treatment Facility - Mental Health Related
 F40 Hot Line, Crisis Intervention Services
 F42 Rape Victim Services
 F50 Addictive Disorders N.E.C.
 F52 Smoking Addiction
 F53 Eating Disorder, Addiction
 F54 Gambling Addiction
 F60 Counseling, Support Groups
 F70 Mental Health Disorders
 F80 Mental Health Association, Multipurpose
 F99 Mental Health, Crisis Intervention N.E.C.
 G01 Alliance/Advocacy Organizations
 G02 Management & Technical Assistance
 G03 Professional Societies, Associations
 G05 Research Institutes and/or Public Policy Analysis
 G11 Single Organization Support
 G12 Fund Raising and/or Fund Distribution
 G19 Nonmonetary Support N.E.C.
 G20 Birth Defects and Genetic Diseases
 G25 Down Syndrome
 G30 Cancer
 G40 Diseases of Specific Organs
 G41 Eye Diseases, Blindness and Vision Impairments
 G42 Ear and Throat Diseases
 G43 Heart and Circulatory System Diseases, Disorders
 G44 Kidney Disease
 G45 Lung Disease
 G48 Brain Disorders
 G50 Nerve, Muscle and Bone Diseases
 G51 Arthritis
 G54 Epilepsy
 G60 Allergy Related Diseases
 G61 Asthma
 G70 Digestive Diseases, Disorders
 G80 Specifically Named Diseases
 G81 AIDS
 G83 Alzheimer's Disease
 G84 Autism
 G90 Medical Disciplines
 G92 Biomedicine, Bioengineering
 G94 Geriatrics
 G96 Neurology, Neuroscience
 G98 Pediatrics
 G9B Surgery
 G99 Diseases, Disorders, Medical Disciplines N.E.C.
 H01 Alliance/Advocacy Organizations
 H02 Management & Technical Assistance
 H03 Professional Societies, Associations
 H05 Research Institutes and/or Public Policy Analysis
 H11 Single Organization Support
 H12 Fund Raising and/or Fund Distribution
 H19 Nonmonetary Support N.E.C.
 H20 Birth Defects, Genetic Diseases Research
 H25 Down Syndrome Research
 H30 Cancer Research
 H40 Specific Organ Research
 H41 Eye Research
 H42 Ear and Throat Research
 H43 Heart, Circulatory Research
 H44 Kidney Research
 H45 Lung Research
 H48 Brain Disorders Research
 H50 Nerve, Muscle, Bone Research
 H51 Arthritis Research
 H54 Epilepsy Research
 H60 Allergy Related Disease Research
 H61 Asthma Research
 H70 Digestive Disease, Disorder Research
 H80 Specifically Named Diseases Research
 H81 AIDS Research
 H83 Alzheimer's Disease Research
 H84 Autism Research
 H90 Medical Specialty Research
 H92 Biomedicine, Bioengineering Research
 H94 Geriatrics Research
 H96 Neurology, Neuroscience Research
 H98 Pediatrics Research
 H9B Surgery Research
 H99 Medical Research N.E.C.
 I01 Alliance/Advocacy Organizations
 I02 Management & Technical Assistance
 I03 Professional Societies, Associations
 I05 Research Institutes and/or Public Policy Analysis
 I11 Single Organization Support
 I12 Fund Raising and/or Fund Distribution
 I19 Nonmonetary Support N.E.C.
 I20 Crime Prevention N.E.C.
 I21 Delinquency Prevention
 I23 Drunk Driving Related
 I30 Correctional Facilities N.E.C.
 I31 Transitional Care, Half-Way House for Offenders, Ex-Offenders
 I40 Rehabilitation Services for Offenders
 I43 Services to Prisoners and Families - Multipurpose
 I44 Prison Alternatives
 I50 Administration of Justice, Courts
 I51 Dispute Resolution, Mediation Services
 I60 Law Enforcement Agencies (Police Departments)
 I70 Protection Against, Prevention of Neglect, Abuse, Exploitation
 I71 Spouse Abuse, Prevention of
 I72 Child Abuse, Prevention of
 I73 Sexual Abuse, Prevention of
 I80 Legal Services
 I83 Public Interest Law, Litigation
 I99 Crime, Legal Related N.E.C.
 J01 Alliance/Advocacy Organizations
 J02 Management & Technical Assistance
 J03 Professional Societies, Associations
 J05 Research Institutes and/or Public Policy Analysis
 J11 Single Organization Support
 J12 Fund Raising and/or Fund Distribution
 J19 Nonmonetary Support N.E.C.
 J20 Employment Procurement Assistance, Job Training
 J21 Vocational Counseling, Guidance and Testing
 J22 Vocational Training
 J30 Vocational Rehabilitation
 J32 Goodwill Industries
 J33 Sheltered Remunerative Employment, Work Activity Center N.E.C.
 J40 Labor Unions, Organizations
 J99 Employment, Job Related N.E.C.
 K01 Alliance/Advocacy Organizations
 K02 Management & Technical Assistance
 K03 Professional Societies, Associations
 K05 Research Institutes and/or Public Policy Analysis
 K11 Single Organization Support
 K12 Fund Raising and/or Fund Distribution
 K19 Nonmonetary Support N.E.C.
 K20 Agricultural Programs
 K25 Farmland Preservation
 K26 Livestock Breeding, Development, Management
 K28 Farm Bureau, Grange
 K30 Food Service, Free Food Distribution Programs
 K31 Food Banks, Food Pantries
 K34 Congregate Meals
 K35 Eatery, Agency, Organization Sponsored
 K36 Meals on Wheels
 K40 Nutrition Programs
 K50 Home Economics
 K99 Food, Agriculture, and Nutrition N.E.C.
 L01 Alliance/Advocacy Organizations
 L02 Management & Technical Assistance
 L03 Professional Societies, Associations
 L05 Research Institutes and/or Public Policy Analysis
 L11 Single Organization Support
 L12 Fund Raising and/or Fund Distribution
 L19 Nonmonetary Support N.E.C.
 L20 Housing Development, Construction, Management
 L21 Public Housing Facilities
 L22 Senior Citizens' Housing/Retirement Communities
 L25 Housing Rehabilitation
 L30 Housing Search Assistance
 L40 Low-Cost Temporary Housing
 L41 Homeless, Temporary Shelter For
 L50 Housing Owners, Renters Organizations
 L80 Housing Support Services -- Other
 L81 Home Improvement and Repairs
 L82 Housing Expense Reduction Support
 L99 Housing, Shelter N.E.C.
 M01 Alliance/Advocacy Organizations
 M02 Management & Technical Assistance
 M03 Professional Societies, Associations
 M05 Research Institutes and/or Public Policy Analysis
 M11 Single Organization Support
 M12 Fund Raising and/or Fund Distribution
 M19 Nonmonetary Support N.E.C.
 M20 Disaster Preparedness and Relief Services
 M23 Search and Rescue Squads, Services
 M24 Fire Prevention, Protection, Control
 M40 Safety Education
 M41 First Aid Training, Services
 M42 Automotive Safety
 M99 Public Safety, Disaster Preparedness, and Relief N.E.C.
 N01 Alliance/Advocacy Organizations
 N02 Management & Technical Assistance
 N03 Professional Societies, Associations
 N05 Research Institutes and/or Public Policy Analysis
 N11 Single Organization Support
 N12 Fund Raising and/or Fund Distribution
 N19 Nonmonetary Support N.E.C.
 N20 Recreational and Sporting Camps
 N30 Physical Fitness and Community Recreational Facilities
 N31 Community Recreational Centers
 N32 Parks and Playgrounds
 N40 Sports Training Facilities, Agencies
 N50 Recreational, Pleasure, or Social Club
 N52 Fairs, County and Other
 N60 Amateur Sports Clubs, Leagues, N.E.C.
 N61 Fishing, Hunting Clubs
 N62 Basketball
 N63 Baseball, Softball
 N64 Soccer Clubs, Leagues
 N65 Football Clubs, Leagues
 N66 Tennis, Racquet Sports Clubs, Leagues
 N67 Swimming, Water Recreation
 N68 Winter Sports (Snow and Ice)
 N69 Equestrian, Riding
 N6A Golf
 N70 Amateur Sports Competitions
 N71 Olympics Committees and Related International Competitions
 N72 Special Olympics
 N80 Professional Athletic Leagues
 N99 Recreation, Sports, Leisure, Athletics N.E.C.
 O01 Alliance/Advocacy Organizations
 O02 Management & Technical Assistance
 O03 Professional Societies, Associations
 O05 Research Institutes and/or Public Policy Analysis
 O11 Single Organization Support
 O12 Fund Raising and/or Fund Distribution
 O19 Nonmonetary Support N.E.C.
 O20 Youth Centers, Clubs, Multipurpose
 O21 Boys Clubs
 O22 Girls Clubs
 O23 Boys and Girls Clubs (Combined)
 O30 Adult, Child Matching Programs
 O31 Big Brothers, Big Sisters
 O40 Scouting Organizations
 O41 Boy Scouts of America
 O42 Girl Scouts of the U.S.A.
 O43 Camp Fire
 O50 Youth Development Programs, Other
 O51 Youth Community Service Clubs
 O52 Youth Development - Agricultural
 O53 Youth Development - Business
 O54 Youth Development - Citizenship Programs
 O55 Youth Development - Religious Leadership
 O99 Youth Development N.E.C.
 P01 Alliance/Advocacy Organizations
 P02 Management & Technical Assistance
 P03 Professional Societies, Associations
 P05 Research Institutes and/or Public Policy Analysis
 P11 Single Organization Support
 P12 Fund Raising and/or Fund Distribution
 P19 Nonmonetary Support N.E.C.
 P20 Human Service Organizations - Multipurpose
 P21 American Red Cross
 P22 Urban League
 P24 Salvation Army
 P26 Volunteers of America
 P27 Young Men's or Women's Associations (YMCA, YWCA, YWHA, YMHA)
 P28 Neighborhood Centers, Settlement Houses
 P29 Thrift Shops
 P30 Children's, Youth Services
 P31 Adoption
 P32 Foster Care
 P33 Child Day Care
 P40 Family Services
 P42 Single Parent Agencies, Services
 P43 Family Violence Shelters, Services
 P44 Homemaker, Home Health Aide
 P45 Family Services, Adolescent Parents
 P46 Family Counseling
 P50 Personal Social Services
 P51 Financial Counseling, Money Management
 P52 Transportation, Free or Subsidized
 P58 Gift Distribution
 P60 Emergency Assistance (Food, Clothing, Cash)
 P61 Travelers' Aid
 P62 Victims' Services
 P70 Residential, Custodial Care
 P72 Half-Way House (Short-Term Residential Care)
 P73 Group Home (Long Term)
 P74 Hospice
 P75 Senior Continuing Care Communities
 P80 Services to Promote the Independence of Specific Populations
 P81 Senior Centers, Services
 P82 Developmentally Disabled Centers, Services
 P84 Ethnic, Immigrant Centers, Services
 P85 Homeless Persons Centers, Services
 P86 Blind/Visually Impaired Centers, Services
 P87 Deaf/Hearing Impaired Centers, Services
 P99 Human Services - Multipurpose and Other N.E.C.
 Q01 Alliance/Advocacy Organizations
 Q02 Management & Technical Assistance
 Q03 Professional Societies, Associations
 Q05 Research Institutes and/or Public Policy Analysis
 Q11 Single Organization Support
 Q12 Fund Raising and/or Fund Distribution
 Q19 Nonmonetary Support N.E.C.
 Q20 Promotion of International Understanding
 Q21 International Cultural Exchange
 Q22 International Student Exchange and Aid
 Q23 International Exchanges, N.E.C.
 Q30 International Development, Relief Services
 Q31 International Agricultural Development
 Q32 International Economic Development
 Q33 International Relief
 Q40 International Peace and Security
 Q41 Arms Control, Peace Organizations
 Q42 United Nations Association
 Q43 National Security, Domestic
 Q70 International Human Rights
 Q71 International Migration, Refugee Issues
 Q99 International, Foreign Affairs, and National Security N.E.C.
 R01 Alliance/Advocacy Organizations
 R02 Management & Technical Assistance
 R03 Professional Societies, Associations
 R05 Research Institutes and/or Public Policy Analysis
 R11 Single Organization Support
 R12 Fund Raising and/or Fund Distribution
 R19 Nonmonetary Support N.E.C.
 R20 Civil Rights, Advocacy for Specific Groups
 R22 Minority Rights
 R23 Disabled Persons' Rights
 R24 Women's Rights
 R25 Seniors' Rights
 R26 Lesbian, Gay Rights
 R30 Intergroup, Race Relations
 R40 Voter Education, Registration
 R60 Civil Liberties Advocacy
 R61 Reproductive Rights
 R62 Right to Life
 R63 Censorship, Freedom of Speech and Press Issues
 R67 Right to Die, Euthanasia Issues
 R99 Civil Rights, Social Action, Advocacy N.E.C.
 S01 Alliance/Advocacy Organizations
 S02 Management & Technical Assistance
 S03 Professional Societies, Associations
 S05 Research Institutes and/or Public Policy Analysis
 S11 Single Organization Support
 S12 Fund Raising and/or Fund Distribution
 S19 Nonmonetary Support N.E.C.
 S20 Community, Neighborhood Development, Improvement (General)
 S21 Community Coalitions
 S22 Neighborhood, Block Associations
 S30 Economic Development
 S31 Urban, Community Economic Development
 S32 Rural Development
 S40 Business and Industry
 S41 Promotion of Business
 S43 Management Services for Small Business, Entrepreneurs
 S46 Boards of Trade
 S47 Real Estate Organizations
 S50 Nonprofit Management
 S80 Community Service Clubs
 S81 Women's Service Clubs
 S82 Men's Service Clubs
 S99 Community Improvement, Capacity Building N.E.C.
 T01 Alliance/Advocacy Organizations
 T02 Management & Technical Assistance
 T03 Professional Societies, Associations
 T05 Research Institutes and/or Public Policy Analysis
 T11 Single Organization Support
 T12 Fund Raising and/or Fund Distribution
 T19 Nonmonetary Support N.E.C.
 T20 Private Grantmaking Foundations
 T21 Corporate Foundations
 T22 Private Independent Foundations
 T23 Private Operating Foundations
 T30 Public Foundations
 T31 Community Foundations
 T40 Voluntarism Promotion
 T50 Philanthropy, Charity, Voluntarism Promotion, General
 T70 Fund Raising Organizations That Cross Categories
 T90 Named Trusts/Foundations N.E.C.
 T99 Philanthropy, Voluntarism, and Grantmaking Foundations N.E.C.
 U01 Alliance/Advocacy Organizations
 U02 Management & Technical Assistance
 U03 Professional Societies, Associations
 U05 Research Institutes and/or Public Policy Analysis
 U11 Single Organization Support
 U12 Fund Raising and/or Fund Distribution
 U19 Nonmonetary Support N.E.C.
 U20 Science, General
 U21 Marine Science and Oceanography
 U30 Physical Sciences, Earth Sciences Research and Promotion
 U31 Astronomy
 U33 Chemistry, Chemical Engineering
 U34 Mathematics
 U36 Geology
 U40 Engineering and Technology Research, Services
 U41 Computer Science
 U42 Engineering
 U50 Biological, Life Science Research
 U99 Science and Technology Research Institutes, Services N.E.C.
 V01 Alliance/Advocacy Organizations
 V02 Management & Technical Assistance
 V03 Professional Societies, Associations
 V05 Research Institutes and/or Public Policy Analysis
 V11 Single Organization Support
 V12 Fund Raising and/or Fund Distribution
 V19 Nonmonetary Support N.E.C.
 V20 Social Science Institutes, Services
 V21 Anthropology, Sociology
 V22 Economics (as a social science)
 V23 Behavioral Science
 V24 Political Science
 V25 Population Studies
 V26 Law, International Law, Jurisprudence
 V30 Interdisciplinary Research
 V31 Black Studies
 V32 Women's Studies
 V33 Ethnic Studies
 V34 Urban Studies
 V35 International Studies
 V36 Gerontology (as a social science)
 V37 Labor Studies
 V99 Social Science Research Institutes, Services N.E.C.
 W01 Alliance/Advocacy Organizations
 W02 Management & Technical Assistance
 W03 Professional Societies, Associations
 W05 Research Institutes and/or Public Policy Analysis
 W11 Single Organization Support
 W12 Fund Raising and/or Fund Distribution
 W19 Nonmonetary Support N.E.C.
 W20 Government and Public Administration
 W22 Public Finance, Taxation, Monetary Policy
 W24 Citizen Participation
 W30 Military, Veterans' Organizations
 W40 Public Transportation Systems, Services
 W50 Telephone, Telegraph and Telecommunication Services
 W60 Financial Institutions, Services (Non-Government Related)
 W61 Credit Unions
 W70 Leadership Development
 W80 Public Utilities
 W90 Consumer Protection, Safety
 W99 Public, Society Benefit - Multipurpose and Other N.E.C.
 X01 Alliance/Advocacy Organizations
 X02 Management & Technical Assistance
 X03 Professional Societies, Associations
 X05 Research Institutes and/or Public Policy Analysis
 X11 Single Organization Support
 X12 Fund Raising and/or Fund Distribution
 X19 Nonmonetary Support N.E.C.
 X20 Christian
 X21 Protestant
 X22 Roman Catholic
 X30 Jewish
 X40 Islamic
 X50 Buddhist
 X70 Hindu
 X80 Religious Media, Communications Organizations
 X81 Religious Film, Video
 X82 Religious Television
 X83 Religious Printing, Publishing
 X84 Religious Radio
 X90 Interfaith Issues
 X99 Religion Related, Spiritual Development N.E.C.
 Y01 Alliance/Advocacy Organizations
 Y02 Management & Technical Assistance
 Y03 Professional Societies, Associations
 Y05 Research Institutes and/or Public Policy Analysis
 Y11 Single Organization Support
 Y12 Fund Raising and/or Fund Distribution
 Y19 Nonmonetary Support N.E.C.
 Y20 Insurance Providers, Services
 Y22 Local Benevolent Life Insurance Associations, Mutual Irrigation and Telephone Companies, and Like Organizations
 Y23 Mutual Insurance Company or Association
 Y24 Supplemental Unemployment Compensation
 Y25 State-Sponsored Worker's Compensation Reinsurance Organizations
 Y30 Pension and Retirement Funds
 Y33 Teachers Retirement Fund Association
 Y34 Employee Funded Pension Trust
 Y35 Multi-Employer Pension Plans
 Y40 Fraternal Beneficiary Societies
 Y42 Domestic Fraternal Societies
 Y43 Voluntary Employees Beneficiary Associations (Non-Government)
 Y44 Voluntary Employees Beneficiary Associations (Government)
 Y50 Cemeteries, Burial Services
 Y99 Mutual/Membership Benefit Organizations, Other N.E.C.
 Z99 Unknown
 "

dictionary_irs_ntee_codes <-
  .block_text_to_dict(x = nte_detailed_codes,
                      c("codeNTEE",
                        "typeNTEE")) %>%
  mutate_all(list(function(x) {
    x %>% str_remove_all("\\*") %>% str_squish()
  })) %>%
  mutate(codeNTEEParent = codeNTEE %>% substr(1, 1)) %>%
  select(codeNTEEParent, everything()) %>%
  left_join(dictionary_irs_ntee_parents, by = "codeNTEEParent") %>%
  select(nameNTEEParent, everything())
abresler/govtrackR documentation built on July 11, 2020, 12:30 a.m.