Skip to contents

Examples: "https://open.canada.ca/data", "https://data.ontario.ca", "https://data.gov.uk", "https://data.europa.eu".

Usage

morie_datasets_ckan_search(portal, query, rows = 50L)

Arguments

portal

Character; base URL of the CKAN portal.

query

Character; free-text search.

rows

Integer; max packages to return (default 50).

Value

A data.frame of package metadata.

Examples

# \donttest{
out <- try(morie_datasets_ckan_search(
  portal = "https://open.canada.ca/data",
  query = "policing", rows = 3L))
if (!inherits(out, "try-error")) head(out)
#>   association_type audience author            author_email collection
#> 1                               NA infostats@statcan.gc.ca    primary
#> 2                               NA infostats@statcan.gc.ca    primary
#> 3                               NA infostats@statcan.gc.ca    primary
#>                        creator_user_id
#> 1 6b600515-c266-4584-a219-d084c980fd47
#> 2 6b600515-c266-4584-a219-d084c980fd47
#> 3 6b600515-c266-4584-a219-d084c980fd47
#>                    data_series_issue_identification.fr
#> 1 Tableau 35100079; Anciennement Table CANSIM 254-0006
#> 2 Tableau 35100065; Anciennement Table CANSIM 252-0091
#> 3 Tableau 35100077; Anciennement Table CANSIM 254-0004
#>              data_series_issue_identification.en data_series_name.fr
#> 1 Table 35100079; Formerly CANSIM Table 254-0006             Tableau
#> 2 Table 35100065; Formerly CANSIM Table 252-0091             Tableau
#> 3 Table 35100077; Formerly CANSIM Table 254-0004             Tableau
#>   data_series_name.en      date_published display_flags frequency
#> 1               Table 2026-05-21 08:30:00                     P1Y
#> 2               Table 2017-06-13 08:30:00                     P1Y
#> 3               Table 2026-05-21 08:30:00                     P1Y
#>   geographic_region                                   id imso_approval isopen
#> 1                   8bf00663-6081-4acc-ae57-b27dde913404          true  FALSE
#> 2                   c330ddb1-4589-45c1-9ce4-40e026054803          true  FALSE
#> 3                   b07aa12f-4008-4a99-ad13-d981fa939ab5          true  FALSE
#>   jurisdiction  keywords.fr  keywords.en license_id
#> 1      federal crime et.... crime an.... ca-ogl-lgo
#> 2      federal crime et.... crime an.... ca-ogl-lgo
#> 3      federal crime et.... crime an.... ca-ogl-lgo
#>                      license_title
#> 1 Open Government Licence - Canada
#> 2 Open Government Licence - Canada
#> 3 Open Government Licence - Canada
#>                                                license_url maintainer
#> 1 https://open.canada.ca/en/open-government-licence-canada         NA
#> 2 https://open.canada.ca/en/open-government-licence-canada         NA
#> 3 https://open.canada.ca/en/open-government-licence-canada         NA
#>          maintainer_email           metadata_created          metadata_modified
#> 1 infostats@statcan.gc.ca 2021-04-13T12:53:17.519079 2026-05-21T12:48:25.887566
#> 2 infostats@statcan.gc.ca 2018-06-27T17:17:32.319976 2023-01-17T20:18:27.947564
#> 3 infostats@statcan.gc.ca 2021-04-13T12:53:22.213329 2026-05-21T12:48:24.577416
#>                                   name
#> 1 8bf00663-6081-4acc-ae57-b27dde913404
#> 2 c330ddb1-4589-45c1-9ce4-40e026054803
#> 3 b07aa12f-4008-4a99-ad13-d981fa939ab5
#>                                                                                                                                                                                                                                                                                                                                                                                                          notes
#> 1 Data on police officers (by high-level rank and gender), total number of civilian personnel, special constables and recruits (each by gender). The proportion of total police, civilians, special constables and recruits from total personnel, and also the proportion of high-level ranks from total number of police officers. &nbsp;Data are provided for municipal police services, 2000 to 2023, 2025.
#> 2                                                                                                                                                                                                                                                                                                                                           Police-reported hate crime, by police service, five years of data.
#> 3                      Data on police personnel (police officers by gender, civilian and other personnel), police officers and authorized strength per 100,000 population, authorized police officer strength, population, net gain or loss from hirings and departures, police officers eligible to retire and selected crime statistics. Data is provided for municipal police services, 2000 to 2023, 2025.
#>                                                                                                                                                                                                                                                                                                                                                                                            notes_translated.en
#> 1 Data on police officers (by high-level rank and gender), total number of civilian personnel, special constables and recruits (each by gender). The proportion of total police, civilians, special constables and recruits from total personnel, and also the proportion of high-level ranks from total number of police officers. &nbsp;Data are provided for municipal police services, 2000 to 2023, 2025.
#> 2                                                                                                                                                                                                                                                                                                                                           Police-reported hate crime, by police service, five years of data.
#> 3                      Data on police personnel (police officers by gender, civilian and other personnel), police officers and authorized strength per 100,000 population, authorized police officer strength, population, net gain or loss from hirings and departures, police officers eligible to retire and selected crime statistics. Data is provided for municipal police services, 2000 to 2023, 2025.
#>                                                                                                                                                                                                                                                                                                                                                                                                                               notes_translated.fr
#> 1 Données sur les policiers (selon les grades supérieures et le genre), nombre total des employés civils, agents spéciaux et recrues (chacun selon le genre). La proportion des policiers, employés civils, agents spéciaux et recrues par rapport au personnel total, et aussi la proportion des grades supérieurs par rapport au nombre total de policiers. Les données sont fournis pour les services de police municipaux, 2000 à 2023, 2025.
#> 2                                                                                                                                                                                                                                                                                                                                                      Crimes haineux déclarés par la police, selon le service de police, cinq années de données.
#> 3                   Données sur le personnel policier (policiers et policières, employés civils et autre personnel), policiers et effectif policier autorisé pour 100 000 habitants, effectif policier autorisé, population, gain net ou perte nette - embauches et départs, policiers admissibles à la retraite et certaines statistiques de la criminalité. Les données sont fournis pour les services de police municipaux, 2000 à 2023, 2025.
#>   num_resources num_tags org_title_at_publication.fr
#> 1             5        0          Statistique Canada
#> 2             5        0          Statistique Canada
#> 3             5        0          Statistique Canada
#>   org_title_at_publication.en                      organization.id
#> 1           Statistics Canada A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC
#> 2           Statistics Canada A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC
#> 3           Statistics Canada A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC
#>   organization.name                     organization.title organization.type
#> 1           statcan Statistics Canada | Statistique Canada      organization
#> 2           statcan Statistics Canada | Statistique Canada      organization
#> 3           statcan Statistics Canada | Statistique Canada      organization
#>   organization.description organization.image_url       organization.created
#> 1                                                 2016-09-23T17:26:15.123077
#> 2                                                 2016-09-23T17:26:15.123077
#> 3                                                 2016-09-23T17:26:15.123077
#>   organization.is_organization organization.approval_status organization.state
#> 1                         TRUE                     approved             active
#> 2                         TRUE                     approved             active
#> 3                         TRUE                     approved             active
#>                              owner_org place_of_publication private
#> 1 A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC                        FALSE
#> 2 A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC                        FALSE
#> 3 A0F0FCFC-BC3B-4696-8B6D-E7E411D55BAC                        FALSE
#>   ready_to_publish restrictions spatial_representation_type  state subject
#> 1             true unrestricted                             active     law
#> 2             true unrestricted                             active     law
#> 3             true unrestricted                             active     law
#>                                                                       title
#> 1                     Police personnel by gender, municipal police services
#> 2                             Police-reported hate crime, by police service
#> 3 Police personnel and selected crime statistics, municipal police services
#>                                                                             title_translated.fr
#> 1                              Personnel policier selon le genre, services de police municipaux
#> 2                             Crimes haineux déclarés par la police, selon le service de police
#> 3 Personnel policier et certaines statistiques de la criminalité, services de police municipaux
#>                                                         title_translated.en
#> 1                     Police personnel by gender, municipal police services
#> 2                             Police-reported hate crime, by police service
#> 3 Police personnel and selected crime statistics, municipal police services
#>   topic_category    type
#> 1                dataset
#> 2                dataset
#> 3                dataset
#>                                                                                                                                    url
#> 1 {u'fr': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=fra', u'en': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=eng'}
#> 2 {u'fr': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=fra', u'en': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=eng'}
#> 3 {u'fr': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=fra', u'en': u'http://www5.statcan.gc.ca/cansim/home-accueil?lang=eng'}
#>   version    resources tags groups relationships_as_subject
#> 1      NA c(NA, NA....                                     
#> 2      NA c(NA, NA....                                     
#> 3      NA c(NA, NA....                                     
#>   relationships_as_object
#> 1                        
#> 2                        
#> 3                        
# }