bcgov / bcdata

An R package for searching & retrieving data from the B.C. Data Catalogue
https://bcgov.github.io/bcdata
Apache License 2.0
81 stars 12 forks source link

add groups function. Closes #234 #247

Closed boshek closed 3 years ago

boshek commented 3 years ago

This would implement this behaviour returning a tibble for users to work with:

R> bcdc_group('data-innovation-program')
Group Description: The Data Innovation Program is a data integration and analytics program for government. Government’s programs and services span all
 aspects of life in B.C., such as education, health care, public safety, social services, the economy and the environment. While every B.C. ministry collects and manages its
 own data, the Data Innovation Program securely links and de-identifies data from multiple ministries, giving government analysts a better understanding of B.C.’s complex
 issues. This group represents the data sets that are part of the Data Innovation Program.  For more information about the program, please visit
 https://www2.gov.bc.ca/gov/content?id=2F6E3BF426034EDBA62F3F016EE2313D
Number of datasets: 20
# A tibble: 20 x 3
   title                                                                           id                               name                                                                          
   <chr>                                                                           <chr>                            <chr>                                                                         
 1 Metadata for Health - Perinatal Services                                        1cfcec36-6252-4177-9bfd-b5820e3~ metadata-for-health-perinatal-services                                        
 2 Metadata for K to 12 Socio Economic Status (SES) Index                          94b68713-d696-4749-8cc9-bf63ffa~ metadata-for-k-to-12-socio-economic-status-ses-index                          
 3 Metadata for Income Bands by Postal Code                                        5b5c8ce1-debb-4ec9-b46d-7838a4f~ metadata-for-income-bands-by-postal-code                                      
 4 Metadata for BC Vital Events and Statistics                                     545965cc-9175-4218-a049-816aeaa~ metadata-for-bc-vital-events-and-statistics                                   
 5 Metadata for Health Registration and Premium Billings                           ccb818d6-5603-43da-85b4-2b1998b~ metadata-for-health-registration-and-premium-billings                         
 6 Metadata for Health Central Demographics Files                                  fd383cbb-8e75-4c47-b693-f44e86e~ metadata-for-health-central-demographics-files                                
 7 Metadata for Community Living Programs                                          c706d7b2-4647-4657-8fba-62295bb~ metadata-for-community-living-programs                                        
 8 Metadata for Health Medical Services Plan (MSP) Payment Information File        3849cd71-3c04-4eea-a6f1-fb0012c~ metadata-for-health-medical-services-plan-msp-payment-information-file        
 9 Metadata for Health - Discharge Abstracts Database (Hospital Separations)       d68a257e-80dd-4b07-901e-183c1b4~ metadata-for-health-discharge-abstracts-database-hospital-separations-        
10 Metadata for Health - National Ambulatory Care Reporting System (NACRS)         d856bbf7-679c-4f98-969d-3b27f34~ metadata-for-health-national-ambulatory-care-reporting-system-nacrs-          
11 Metadata for Mental Health Services                                             7e512ac6-47d9-4724-994a-76c9ecb~ metadata-for-mental-health-services                                           
12 Metadata for Health Pharmanet Program                                           6ea9b484-7b9a-48f6-9d95-4c6d91e~ metadata-for-health-pharmanet-program                                         
13 Metadata for Health PharmaCare Program                                          4ed7ace7-2ab8-4ccf-b82b-fa65d43~ metadata-for-health-pharmacare-program                                        
14 Metadata for Family Maintenance and Enforcement Program                         2dd877ad-86cc-4767-96ed-891e730~ metadata-for-family-maintenance-and-enforcement-program                       
15 Metadata for Private Market Rent Supplements for Eligible Seniors and Working ~ 50a0be74-9176-4a65-8625-5e5cee9~ metadata-for-private-market-rent-supplements-for-eligible-seniors-and-working~
16 Metadata for Child Welfare Program                                              5745f9a0-e214-4deb-a881-ffaf9fc~ metadata-for-child-welfare-program                                            
17 Metadata for Labour Market Programs                                             080f3c14-2a84-4a9a-ad32-a71a049~ metadata-for-labour-market-programs                                           
18 Metadata for K to 12 Student Demographics and Achievements                      bd4866d5-cd2d-4f46-afcd-1767608~ metadata-for-k-to-12-student-demographics-and-achievements                    
19 Metadata for BC Employment and Assistance                                       36ad8c2b-a884-44b6-b846-d230673~ metadata-for-bc-employment-and-assistance                                     
20 Metadata for BC Benefits Program                                                9803cef9-0d7b-4f5c-bc39-91dca04~ metadata-for-bc-benefits-program     
boshek commented 3 years ago

This is now implemented as a thin wrapper around bcdc_search_facet:

R> bcdc_list_groups()
# A tibble: 11 x 4
   facet  count display_name                                        name                                             
   <chr>  <int> <chr>                                               <chr>                                            
 1 groups     9 Wildfire Risk Reduction                             wildfire-risk-reduction                          
 2 groups     9 Vegetation Resource Inventory                       vegetation-resource-inventory                    
 3 groups     7 ParcelMap BC                                        pmbc                                             
 4 groups    11 Housing Needs Reports                               housing-needs-reports                            
 5 groups     5 GBA+                                                gba                                              
 6 groups    32 Environmental Reporting BC                          environmental-reporting-bc                       
 7 groups    20 Data Innovation Program                             data-innovation-program                          
 8 groups    24 Census Profiles                                     census-profiles                                  
 9 groups     4 COVID-19                                            covid-19                                         
10 groups    37 Business and Economic Implications Framework (BEIF) business-and-economic-implications-framework-beif
11 groups    11 BC Government API Registry                          bc-government-api-registry 
boshek commented 3 years ago

I am also wondering about the name bcdc_group. The function grabs the record ids of a group. What about bcdc_group_records instead?