search_open_data: Search Data Sets Available from City of Winnipeg Open Data...

Description Usage Arguments Value Examples

View source: R/search_open_data.R

Description

This function uses the jsonlite package to get and search/grep current metadata on the data sets available on the City of Winnipeg Open Data site data.winnipeg.ca. It returns a data frame with descriptions of data, and code to retrieve data sets using get_open_data, or through the open data Socrata API.

Usage

1
2
3
4
5
6
7
search_open_data(
  contains = NA,
  updated_after = "2015-01-01",
  updated_before = as.character(Sys.Date()),
  issued_after = "2015-01-01",
  issued_before = as.character(Sys.Date())
)

Arguments

contains

Optional expression to grep fields in metadata with.

updated_after

Optional date string representing the earliest the data set being searched has been updated.

updated_before

Optional date string representing the most recent the data set being searched has been updated.

issued_after

Optional date string representing the earliest the data set being search could have been initially issued.

issued_before

Optional date string representing the latest the data set being search could have been initially issued.

Value

A dataframe containing the open data set(s) matching input parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
    # Returns all metadata as a data frame
    search_open_data()

    # Examines data sets whose title or description contains 'trees'
    # ignoring case
    search_open_data('trees')

    # Get recently updated data sets
    search_open_data(updated_after = '2019-01-01')

    # Return API short codes for searched data sets
    search_open_data(contains = 'parking')$identifier[1]

## End(Not run)

jdallmann/winnipegr documentation built on Jan. 20, 2020, 2:05 a.m.