From 17296e4bc812c8d8a27718488f5a348c741d4867 Mon Sep 17 00:00:00 2001 From: JsLth <83467140+JsLth@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:22:20 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20JsLth/r3?= =?UTF-8?q?11@5742ed43d463f2eb119da1117e5b6a8eda5c863c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/r311.html | 5 ++--- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/articles/r311.html b/articles/r311.html index 9e8c533..d2683c5 100644 --- a/articles/r311.html +++ b/articles/r311.html @@ -165,8 +165,7 @@
o311_add_endpoint(
name = "San Francisco Test",
- root = "http://mobile311-dev.sfgov.org/open311/v2/",
- jurisdiction = "sfgov.org"
+ root = "http://mobile311-dev.sfgov.org/open311/v2/"
)
Retrieving the endpoints list again confirms that you successfully added a new row to the endpoints dataframe.
@@ -347,7 +346,7 @@The CitySDK extensions also offers additional URL paths which can be
queried using the generic o311_query
function.
diff --git a/pkgdown.yml b/pkgdown.yml index e232158..b6633f8 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: r311: r311.html -last_built: 2024-06-17T15:56Z +last_built: 2024-06-17T17:21Z urls: reference: https://jslth.github.io/r311/reference article: https://jslth.github.io/r311/articles diff --git a/search.json b/search.json index 7cc0b9b..e5e93bb 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://jslth.github.io/r311/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 r311 authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"r311: An R interface to the open311 standard","text":"open311 international open-access standard civic issue management public service communication. standard allows administrations better manage citizen requests, citizens easily participate administrative work, researchers data scientists access data regarding public service communication. open standard, open311 centralized API, framework implemented various cities (e.g. San Francisco, CA, Chicago, IL, Cologne, DE, Turku, FI, Zurich, CH) services (e.g. SeeClickFix, FixMyStreet). way past golden age open311 APIs much development civic issue tracking shifted less open-access less standardized alternatives. Many former prime examples abandoned severely limited open311 endpoints. Nonetheless, open311 still constitutes valuable source open government data. Many cities services still maintain open311 service. r311 allows seamless management selection endpoints retrieval service request data. supports (depend ) many popular R frameworks tidyverse, sf xml2 response formatting. r311 designed slim, content dependencies. imports two import-less packages used HTTP response handling. functionality limited two main features: Endpoint management Sending requests vignette briefly cover two features.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"endpoints","dir":"Articles","previous_headings":"","what":"Endpoints","title":"r311: An R interface to the open311 standard","text":"Since open311 open decentralized standard, one many endpoints one can access. endpoint commonly implemented city administration, can also managed service provider FixMyStreet. endpoint can define multiple jurisdiction IDs, although, practice, endpoints define single jurisdiction. can thus difficult manage multitude endpoints jurisdictions. Efforts made list open311 servers, incomplete outdated. r311 offers updated modifiable endpoint list defines number open311 implementations defined use package. list can read using o311_endpoints. list neither claim comprehensiveness --dateness. arguably provides important easily accessible endpoints 2024. However, r311 also offers ability add new endpoints o311_endpoints using o311_add_endpoint. need provide name (lookup) root URL (URL used send requests). following code adds open311 test server San Francisco. Retrieving endpoints list confirms successfully added new row endpoints dataframe. can now select San Francisco test API session using o311_api. function matches API using endpoint name jurisdiction ID attaches active session. Query functions automatically detect attached API. attaching API, o311_ok confirms selected endpoint able handle request queries. result , can safely start receiving real request data.","code":"o311_endpoints() #> # A tibble: 62 × 9 #> name root docs jurisdiction key pagination limit json dialect #>#> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 52 more rows o311_add_endpoint( name = \"San Francisco Test\", root = \"http://mobile311-dev.sfgov.org/open311/v2/\", jurisdiction = \"sfgov.org\" ) nrow(o311_endpoints()) #> [1] 63 o311_api(\"San Francisco Test\") o311_ok() #> [1] TRUE"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"making-requests","dir":"Articles","previous_headings":"","what":"Making requests","title":"r311: An R interface to the open311 standard","text":"selecting API attaching session, functions can access . can now make requests.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"services","dir":"Articles","previous_headings":"Making requests","what":"Services","title":"r311: An R interface to the open311 standard","text":"get overview available services jurisdiction, can use o311_services, returns list San Francisco’s administrative services.","code":"o311_services() #> # A tibble: 21 × 6 #> service_code service_name description metadata type group #> #> 1 6050cd8ce8961bbfa32bcf2c Shared Spaces Use this o… TRUE batch Gene… #> 2 55d6cb85df86af51c305616e Noise Issue NA TRUE batch Gene… #> 3 5fe20af6e896f754e2784e99 Holiday Tree Remov… NA FALSE batch Stre… #> 4 518d5892601827e3880000c5 Street or Sidewalk… NA TRUE batch Stre… #> 5 518d572e601827e388000058 Garbage Containers Report an … TRUE batch Stre… #> 6 50fea92c4aa48a4a9e000099 Graffiti Report bui… TRUE batch Stre… #> 7 50fea6d54aa48a4a9e00002e Illegal Postings Report han… TRUE batch Stre… #> 8 518d564b601827e38800002d Blocked Pedestrian… NA TRUE batch Stre… #> 9 55e8409a45ff461f92000006 Encampment NA TRUE batch Stre… #> 10 518d5d52601827e3880001b1 Abandoned Vehicles Report a v… TRUE batch Park… #> # ℹ 11 more rows"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"requests","dir":"Articles","previous_headings":"Making requests","what":"Requests","title":"r311: An R interface to the open311 standard","text":"get data civic issues city area, run o311_requests. Using output o311_services, can narrow output requests. Open311 defines set standard parameters implemented endpoints. Using service_code parameter one previously returned service codes, complaints businesses illegally using shared spaces returned. Similarly, using service_request_id output, can retrieve single service request API.","code":"o311_requests() #> Simple feature collection with 50 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.5111 ymin: 37.74945 xmax: -122.3949 ymax: 37.79207 #> Geodetic CRS: WGS 84 #> # A tibble: 50 × 12 #> service_request_id status service_name service_code description #> #> 1 1020140726 open Abandoned Vehicles 518d5d52601… test #> 2 1020140725 open Park Requests 518d5cc9601… test #> 3 1020140302 open Street or Sidewalk Cleani… 518d5892601… Test - gar… #> 4 1020139578 open Street or Sidewalk Cleani… 518d5892601… Garbage on… #> 5 1020139514 open Encampment 55e8409a45f… NA #> 6 1020139513 closed Flooding, Sewer & Water L… 518d5c0d601… -- TEST MA… #> 7 1020139511 open Shared Spaces 6050cd8ce89… NA #> 8 1020139507 open Tree Maintenance 518d595d601… southbound… #> 9 1020139506 open Pothole & Street Issues 50fea9c24aa… southbound… #> 10 1020139505 closed Tree Maintenance 518d595d601… southbound… #> # ℹ 40 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # address , token , status_notes , media_url , #> # geometry o311_requests(service_code = \"6050cd8ce8961bbfa32bcf2c\") #> Simple feature collection with 50 features and 10 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.444 ymin: 37.75765 xmax: -122.3931 ymax: 37.79074 #> Geodetic CRS: WGS 84 #> # A tibble: 50 × 11 #> service_request_id status service_name service_code requested_datetime #> #> 1 1020139511 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-08T23:54:… #> 2 6405413 closed Shared Spaces 6050cd8ce8961bbfa… 2016-10-11T13:17:… #> 3 1020139479 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-05T22:52:… #> 4 1020139460 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-01T17:20:… #> 5 1020139449 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-29T23:30:… #> 6 1020139418 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:53:… #> 7 1020139417 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:43:… #> 8 1020139414 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:31:… #> 9 1020139411 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:23:… #> 10 1020139392 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-17T02:14:… #> # ℹ 40 more rows #> # ℹ 6 more variables: updated_datetime , address , token , #> # status_notes , description , geometry o311_request(\"1020139511\") #> Simple feature collection with 1 feature and 8 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.4183 ymin: 37.775 xmax: -122.4183 ymax: 37.775 #> Geodetic CRS: WGS 84 #> # A tibble: 1 × 9 #> service_request_id status service_name service_code requested_datetime #> #> 1 1020139511 open Shared Spaces 6050cd8ce8961bbfa3… 2023-12-08T23:54:… #> # ℹ 4 more variables: updated_datetime , address , token , #> # geometry "},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"bulk-queries","dir":"Articles","previous_headings":"Making requests","what":"Bulk queries","title":"r311: An R interface to the open311 standard","text":"Many endpoints define page limit meaning responses divided pages. query without parameters returns first page. Pagination can controlled page argument. control pagination, o311_request_all function can come handy. automatically iterates pages heuristically decides stop. following example retrieves data first two pages, resulting tibble 100 service requests.","code":"o311_request_all(max_pages = 2) #> Simple feature collection with 100 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.5111 ymin: 37.73277 xmax: -122.3931 ymax: 37.79207 #> Geodetic CRS: WGS 84 #> # A tibble: 100 × 12 #> service_request_id status service_name service_code description #> #> 1 1020140726 open Abandoned Vehicles 518d5d52601… test #> 2 1020140725 open Park Requests 518d5cc9601… test #> 3 1020140302 open Street or Sidewalk Cleani… 518d5892601… Test - gar… #> 4 1020139578 open Street or Sidewalk Cleani… 518d5892601… Garbage on… #> 5 1020139514 open Encampment 55e8409a45f… NA #> 6 1020139513 closed Flooding, Sewer & Water L… 518d5c0d601… -- TEST MA… #> 7 1020139511 open Shared Spaces 6050cd8ce89… NA #> 8 1020139507 open Tree Maintenance 518d595d601… southbound… #> 9 1020139506 open Pothole & Street Issues 50fea9c24aa… southbound… #> 10 1020139505 closed Tree Maintenance 518d595d601… southbound… #> # ℹ 90 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # address , token , status_notes , media_url , #> # geometry "},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"non-standard-parameters","dir":"Articles","previous_headings":"Making requests","what":"Non-standard parameters","title":"r311: An R interface to the open311 standard","text":"r311 implicitly supports API extensions introducing custom paths parameters. One API Klarschiff Rostock based CitySDK. Klarschiff CitySDK defines number non-default paths parameters extend filtering abilities open311 requests. Available parameters can usually found respective documentation (e.g. GitHub Klarschiff CitySDK). following query returns last 50 requests tagged “idea” keyword. custom parameters can also alter shape output. following example, query just count total requests using just_count parameter. result 1×1 tibble containing count value. CitySDK extensions also offers additional URL paths can queried using generic o311_query function.","code":"o311_api(\"Rostock\") tickets <- o311_requests(keyword = \"idea\", max_requests = 50) o311_requests(just_count = TRUE) #> # A tibble: 1 × 1 #> value #> #> 1 4092 poly <- o311_query(\"areas\") plot(poly$grenze) plot(tickets$geometry, add = TRUE, pch = 16)"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"cleanup","dir":"Articles","previous_headings":"","what":"Cleanup","title":"r311: An R interface to the open311 standard","text":"Endpoint data stored persistently sessions can create database open311 endpoints. database stored system’s user directory returned tools::R_user_dir(\"r311\"). reset database, run default back endpoints defined r311 remove endpoints manually added o311_add_endpoints.","code":"o311_reset_endpoints()"},{"path":"https://jslth.github.io/r311/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jonas Lieth. Author, maintainer, copyright holder.","code":""},{"path":"https://jslth.github.io/r311/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lieth J (2024). r311: R interface open311 standard. R package version 0.3.4, https://jslth.github.io/r311/, https://github.com/JsLth/r311, https://github.com/jslth/r311.","code":"@Manual{, title = {r311: R interface to the open311 standard}, author = {Jonas Lieth}, year = {2024}, note = {R package version 0.3.4, https://jslth.github.io/r311/, https://github.com/JsLth/r311}, url = {https://github.com/jslth/r311}, }"},{"path":"https://jslth.github.io/r311/index.html","id":"r311","dir":"","previous_headings":"","what":"R interface to the open311 standard","title":"R interface to the open311 standard","text":"r311 R interface international standard open311. Open311 APIs used civic issue management public service communication. standard allows administrations better manage citizen requests, citizens easily submit requests, (hence package) researchers data scientists access data regarding public service communication. r311 supports seamless management supplementation available endpoints, selection appropriate APIs access, retrieval civic service request data. Custom queries extensions (e.g. CitySDK) implicitly supported. r311 designed require minimal amount dependencies, allow easy integration common R frameworks tidyverse, sf xml2.","code":""},{"path":"https://jslth.github.io/r311/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R interface to the open311 standard","text":"can install development version open311 GitHub :","code":"# install.packages(\"remotes\") remotes::install_github(\"JsLth/r311\")"},{"path":"https://jslth.github.io/r311/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"R interface to the open311 standard","text":"following example loads r311, sets jurisdiction retrieves small amount data service tickets Cologne, Germany.","code":"library(r311) o311_api(\"Cologne\") o311_requests() #> Simple feature collection with 100 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: 6.829609 ymin: 50.8609 xmax: 7.10357 ymax: 51.06044 #> Geodetic CRS: WGS 84 #> # A tibble: 100 × 12 #> service_request_id title description address_string service_name #> * #> 1 7748-2024 #7748-2024 Schrot… \"Schwarzer… 51067 Köln - … Schrott-Kfz #> 2 7775-2024 #7775-2024 Lichtm… \"Seit dem … 51105 Köln - … Lichtmast d… #> 3 7776-2024 #7776-2024 Lichtm… \"Seit dem … 51105 Köln - … Lichtmast d… #> 4 7777-2024 #7777-2024 Wilder… \"An der Ei… 50679 Köln - … Wilder Müll #> 5 7783-2024 #7783-2024 Straße… \"Baustelle… 50823 Köln - … Straßenbaus… #> 6 7795-2024 #7795-2024 Straße… \"Ergänzung… 50823 Köln - … Straßenbaus… #> 7 7817-2024 #7817-2024 Schrot… \"Hallo, \\r… 51147 Köln - … Schrott-Kfz #> 8 7824-2024 #7824-2024 Schrot… \"Hinteraus… 51065 Köln - … Schrottfahr… #> 9 7834-2024 #7834-2024 Fußgän… \"Gestern w… 51103 Köln - … Fußgängeram… #> 10 7838-2024 #7838-2024 Spiel-… \"Sehr geeh… Köln, Spiel- und … #> # ℹ 90 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # status , media_url , status_note , service_code , #> # geometry "},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Select an open311 API — o311_api","title":"Select an open311 API — o311_api","text":"Select open311 API attach active session. open311 API implementation open311 standard. consists endpoint name (e.g. city), root URL, jurisdiction ID. unambiguously identify API, can provide endpoint, jurisdiction ID, . input matched o311_endpoints select API. selected API available o311_* functions session terminated overwritten.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select an open311 API — o311_api","text":"","code":"o311_api(endpoint = NULL, jurisdiction = NULL, format = c(\"json\", \"xml\"))"},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select an open311 API — o311_api","text":"endpoint [character] Name endpoint runs open311 API. usually city, can provider open311 API. jurisdiction [character] ID jurisdiction served open311 API. jurisdiction ID usually root URL jurisdiction website, e.g. \"sfgov.org\" San Francisco. format [character] Response format. Must one \"json\" \"xml\". Defaults \"json\" simplification difficult unsafe xml2 objects. advisable use \"json\" whenever possible applicable. Additionally, \"xml\" requires xml2 package queries xmlconvert package simplification.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select an open311 API — o311_api","text":"list containing important information given jurisdiction, invisibly. list attached session can retrieved calling o311_api() without arguments.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select an open311 API — o311_api","text":"theory, several jurisdictions can exist single endpoints, e.g. region serves multiple jurisdictions. Similarly, multiple endpoints can exist single jurisdiction, e.g. provider set production test endpoints jurisdictions. Providing endpoint jurisdiction thus safe way identify API. default, handful endpoints supported. list currently supported endpoints, run o311_endpoints. can add non-default endpoints using o311_add_endpoint.","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select an open311 API — o311_api","text":"","code":"# cities are matched using regex o311_api(\"Cologne\") # passing a jurisdiction is more explicit o311_api(jurisdiction = \"stadt-koeln.de\") # calls without arguments return the current API o311_api() #> $name #> [1] \"Köln / Cologne, DE\" #> #> $root #> [1] \"https://sags-uns.stadt-koeln.de/georeport/v2/\" #> #> $docs #> NULL #> #> $jurisdiction #> [1] \"stadt-koeln.de\" #> #> $key #> [1] FALSE #> #> $pagination #> [1] TRUE #> #> $limit #> [1] 50 #> #> $json #> [1] TRUE #> #> $dialect #> [1] \"Mark-a-Spot\" #>"},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":null,"dir":"Reference","previous_headings":"","what":"API discovery — o311_discovery","title":"API discovery — o311_discovery","text":"Retrieve discovery information mounted endpoint.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"API discovery — o311_discovery","text":"","code":"o311_discovery()"},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"API discovery — o311_discovery","text":"list containing details given open311 API.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"API discovery — o311_discovery","text":"","code":"if (FALSE) { o311_api(\"zurich\") o311_discovery() }"},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":null,"dir":"Reference","previous_headings":"","what":"Endpoints — o311_add_endpoint","title":"Endpoints — o311_add_endpoint","text":"Modify examine defined open311 endpoints. o311_endpoints() retrieves list endpoints including additional information. o311_add_endpoint adds list define new endpoint can used queries. o311_reset_endpoints restores initial state endpoints list.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Endpoints — o311_add_endpoint","text":"","code":"o311_add_endpoint( name, root, jurisdiction = NULL, key = FALSE, pagination = FALSE, limit = NULL, json = TRUE, dialect = NULL ) o311_reset_endpoints() o311_endpoints(...)"},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Endpoints — o311_add_endpoint","text":"name [character] Name endpoint / city. name can arbitrary serves identification [o311_api]. root [character] Base URL endpoint sending production-grade requests. root URL commonly points \"georeport/v2/\". jurisdiction [character] Unique identifier jurisdiction. jurisdiction typically defined domain respective city website. optional endpoints serve one jurisdiction. key [logical] API key mandatory? pagination [logical] requests responses paginated? limit [integer] paginated, many requests one page contain? json [logical] JSON responses supported? FALSE, defaults \"XML\" responses. See also o311_api. dialect [character] open311 extension endpoint built . Common dialects include CitySDK, Connected Bits, SeeClickFix Mark--Spot. Currently, argument nothing, used future adjust response handling based dialect. ... List key-value pairs pair filter. key represents column value requested column value. keys must present column names o311_endpoints().","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Endpoints — o311_add_endpoint","text":"o311_endpoints, dataframe containing relevant information endpoint. o311_add_endpoint, new endpoint, invisibly. o311_reset_endpoints returns NULL invisibly. new endpoint duplicate, NULL returned invisibly.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Endpoints — o311_add_endpoint","text":"o311_endpoints() returns static list defined package installation directory. list contains limited number endpoints proven work time package development. include newer/smaller/less known endpoints test APIs. can manually added using o311_add_endpoint.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Endpoints — o311_add_endpoint","text":"function uses R_user_dir persistently store custom endpoints data sessions. set different directory, may use options(\"o311_user_dir\"). clean , run o311_reset_endpoints() deletes package-specific user directory defaults back system.file(\"endpoints.json\", package = \"r311\").","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Endpoints — o311_add_endpoint","text":"","code":"# read default endpoints o311_endpoints() #> # A tibble: 62 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 52 more rows # get all endpoints powered by Connected Bits o311_endpoints(dialect = \"Connected Bits\") #> # A tibble: 7 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 2 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 3 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 4 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 5 Newport News, VA http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 6 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 7 San Francisco, … http… http… NA FALSE TRUE 50 TRUE Connec… # add a new endpoint o311_add_endpoint(name = \"test\", root = \"test.org/georeport/v2\") # read new endpoints o311_endpoints() #> # A tibble: 63 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 53 more rows # reset endpoints back to default o311_reset_endpoints()"},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":null,"dir":"Reference","previous_headings":"","what":"Is open311 API ok? — o311_ok","title":"Is open311 API ok? — o311_ok","text":"Checks whether open311 API mounted o311_api reachable returns valid requests response.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is open311 API ok? — o311_ok","text":"","code":"o311_ok(error = FALSE)"},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is open311 API ok? — o311_ok","text":"error [logical] Whether return logical error message describing API ok.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is open311 API ok? — o311_ok","text":"logical describing whether API reachable . error = TRUE, returns corresponding error object one occurs.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is open311 API ok? — o311_ok","text":"","code":"if (FALSE) { # check if Bonn API is reachable o311_api(\"Bonn\") o311_ok() # check if Helsinki API is reachable - fails o311_add_endpoint( name = \"Helsinki\", root = \"asiointi.hel.fi/palautews/rest/v1/\" ) o311_api(\"Helsinki\") o311_ok() # return error message o311_ok(error = TRUE) }"},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Query an open311 endpoint — o311_query","title":"Query an open311 endpoint — o311_query","text":"Low-level function perform generic request API currently attached o311_api. open311 implementations support unique operations included official documentation. function can used access URL paths.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query an open311 endpoint — o311_query","text":"","code":"o311_query(path, ..., simplify = TRUE)"},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query an open311 endpoint — o311_query","text":"path Path appendix used access endpoint-specific operations. ... Additional query parameters. simplify Whether simplify output using jsonlite::toJSON(..., simplify = TRUE).","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query an open311 endpoint — o311_query","text":"parsed query output, either list dataframe.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query an open311 endpoint — o311_query","text":"can set options(r311_echo = TRUE) display requests sent using o311_query.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query an open311 endpoint — o311_query","text":"","code":"if (FALSE) { o311_api(\"rostock\") # manually query discovery o311_query(path = \"discovery\", simplify = FALSE) # query a custom path defined by the Klarschiff API o311_query(path = \"areas\") }"},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":null,"dir":"Reference","previous_headings":"","what":"Get civic service request data — o311_requests","title":"Get civic service request data — o311_requests","text":"Get civic service request data registered open311 endpoint. o311_request queries single service request ID. o311_requests queries single page service requests. o311_request_all tries iterate pages endpoint return complete dataset service requests.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get civic service request data — o311_requests","text":"","code":"o311_requests( service_code = NULL, start_date = NULL, end_date = NULL, status = NULL, page = NULL, ... ) o311_request(service_request_id, ...) o311_request_all( service_code = NULL, start_date = NULL, end_date = NULL, status = NULL, ..., max_pages = Inf, progress = TRUE )"},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get civic service request data — o311_requests","text":"service_code [character] IDs service types queried. Defaults available codes endpoint. list available service codes can retrieved using o311_services. start_date, end_date [POSIXt] Start date end date query results. Must date-time objects. specified, defaults last 90 days. status [character] Status public service ticket. Can one \"open\" \"closed\". NULL, returns types tickets. page [integer] Page response. endpoints paginate responses way limited number tickets returned query. retrieve data, consider using o311_request_all. ... endpoint-specific parameters documented respective endpoint reference. service_request_id [character] Identifier single service request. Request IDs can usually retrieved o311_requests. max_pages [integer] Number pages search result returned. progress [logical] Whether show waiter indicating current page iteration.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get civic service request data — o311_requests","text":"dataframe containing data civic service requests. dataframe can contain varying columns depending open311 implementation.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get civic service request data — o311_requests","text":"o311_request_all applies number checks determine stop searching. First, many endpoints return error last page exceeded. Thus, last page request failed, break. Second, exceeding pagination limit return error, response compared previous response. identical, response discarded previous responses returned. Finally, page exceeds max_pages, responses point returned. open311 leaves space endpoints implement request parameters. parameters can provided using dot arguments. arguments validated pre-processed. Date-time objects must formatted according w3c standard. common parameters include: q: Perform text search across requests. update_after/updated_before: Limit request according request update dates. per_page: Specifiy maximum number requests per page. extensions: Adds nested attribute \"extended_attributes\" response. long/lat/radius: Searches requests fixed radius around coordinate. dot arguments deviate open311 standard, guaranteed available every endpoint might removed without notice. Refer endpoint docs learn custom parameters (o311_endpoints()$docs).","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get civic service request data — o311_requests","text":"","code":"if (FALSE) { o311_api(\"chicago\") # retrieve requests from the last two days now <- Sys.time() two_days <- 60 * 60 * 24 * 2 o311_requests(end_date = now, start_date = now - two_days) # retrieve only open tickets tickets <- o311_requests(status = \"open\") # request the first ticket of the previous response o311_request(tickets$service_request_id[1]) # request all data o311_request_all() # request data of the first 5 pages o311_request_all(max_pages = 5) }"},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":null,"dir":"Reference","previous_headings":"","what":"Get service list — o311_services","title":"Get service list — o311_services","text":"Get list available services. Services unique endpoint / city thus require attached jurisdiction using o311_api.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get service list — o311_services","text":"","code":"o311_services(...) o311_service(service_code, ...)"},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get service list — o311_services","text":"... endpoint-specific parameters documented respective endpoint reference. service_code Identifier single service definition. Service codes can usually retrieved o311_services.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get service list — o311_services","text":"dataframe list containing information service.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get service list — o311_services","text":"","code":"if (FALSE) { # set up a jurisdiction o311_add_endpoint( name = \"helsinki test\", root = \"https://dev.hel.fi/open311-test/v1/\" ) o311_api(\"helsinki test\") # get a list of all services services <- o311_services() # get a service list in finnish # the locale parameter is specific to the Helsinki API o311_services(locale = \"fi_FI\") # inspect a service code o311_service(services$service_code[1]) }"},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate endpoints — validate_endpoints","title":"Validate endpoints — validate_endpoints","text":"Checks whether endpoints correctly defined, reachable, /valid. Iterates endpoints defined o311_endpoints returns status along reason, applicable.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate endpoints — validate_endpoints","text":"","code":"validate_endpoints( idx = NULL, checks = c(\"discovery\", \"services\", \"requests\"), methods = c(\"formal\", \"down\", \"valid\") )"},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate endpoints — validate_endpoints","text":"idx Index numbers endpoints check. Index numbers follow row numbers o311_endpoints. checks open311 method check. default, checks methods. methods checks apply. formal checks whether endpoint uniquely identifiable given names jurisdictions o311_endpoints. checks whether endpoint reachable ready requests. valid checks whether method returns valid output, .e. list dataframe 0 rows/elements. default, applies methods.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate endpoints — validate_endpoints","text":"dataframe containing name endpoint, one three columns check results, one three columns reasons check turned negative.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate endpoints — validate_endpoints","text":"","code":"if (FALSE) { # check all endpoints and methods validate_endpoints() # check only requests validate_endpoints(checks = \"requests\") # check only if an endpoint is down validate_endpoints(checks = \"down\") }"},{"path":"https://jslth.github.io/r311/news/index.html","id":"r311-031","dir":"Changelog","previous_headings":"","what":"r311 0.3.1","title":"r311 0.3.1","text":"Initial CRAN submission.","code":""}] +[{"path":"https://jslth.github.io/r311/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 r311 authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"r311: An R interface to the open311 standard","text":"open311 international open-access standard civic issue management public service communication. standard allows administrations better manage citizen requests, citizens easily participate administrative work, researchers data scientists access data regarding public service communication. open standard, open311 centralized API, framework implemented various cities (e.g. San Francisco, CA, Chicago, IL, Cologne, DE, Turku, FI, Zurich, CH) services (e.g. SeeClickFix, FixMyStreet). way past golden age open311 APIs much development civic issue tracking shifted less open-access less standardized alternatives. Many former prime examples abandoned severely limited open311 endpoints. Nonetheless, open311 still constitutes valuable source open government data. Many cities services still maintain open311 service. r311 allows seamless management selection endpoints retrieval service request data. supports (depend ) many popular R frameworks tidyverse, sf xml2 response formatting. r311 designed slim, content dependencies. imports two import-less packages used HTTP response handling. functionality limited two main features: Endpoint management Sending requests vignette briefly cover two features.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"endpoints","dir":"Articles","previous_headings":"","what":"Endpoints","title":"r311: An R interface to the open311 standard","text":"Since open311 open decentralized standard, one many endpoints one can access. endpoint commonly implemented city administration, can also managed service provider FixMyStreet. endpoint can define multiple jurisdiction IDs, although, practice, endpoints define single jurisdiction. can thus difficult manage multitude endpoints jurisdictions. Efforts made list open311 servers, incomplete outdated. r311 offers updated modifiable endpoint list defines number open311 implementations defined use package. list can read using o311_endpoints. list neither claim comprehensiveness --dateness. arguably provides important easily accessible endpoints 2024. However, r311 also offers ability add new endpoints o311_endpoints using o311_add_endpoint. need provide name (lookup) root URL (URL used send requests). following code adds open311 test server San Francisco. Retrieving endpoints list confirms successfully added new row endpoints dataframe. can now select San Francisco test API session using o311_api. function matches API using endpoint name jurisdiction ID attaches active session. Query functions automatically detect attached API. attaching API, o311_ok confirms selected endpoint able handle request queries. result , can safely start receiving real request data.","code":"o311_endpoints() #> # A tibble: 62 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 52 more rows o311_add_endpoint( name = \"San Francisco Test\", root = \"http://mobile311-dev.sfgov.org/open311/v2/\" ) nrow(o311_endpoints()) #> [1] 63 o311_api(\"San Francisco Test\") o311_ok() #> [1] TRUE"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"making-requests","dir":"Articles","previous_headings":"","what":"Making requests","title":"r311: An R interface to the open311 standard","text":"selecting API attaching session, functions can access . can now make requests.","code":""},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"services","dir":"Articles","previous_headings":"Making requests","what":"Services","title":"r311: An R interface to the open311 standard","text":"get overview available services jurisdiction, can use o311_services, returns list San Francisco’s administrative services.","code":"o311_services() #> # A tibble: 21 × 6 #> service_code service_name description metadata type group #> #> 1 6050cd8ce8961bbfa32bcf2c Shared Spaces Use this o… TRUE batch Gene… #> 2 55d6cb85df86af51c305616e Noise Issue NA TRUE batch Gene… #> 3 5fe20af6e896f754e2784e99 Holiday Tree Remov… NA FALSE batch Stre… #> 4 518d5892601827e3880000c5 Street or Sidewalk… NA TRUE batch Stre… #> 5 518d572e601827e388000058 Garbage Containers Report an … TRUE batch Stre… #> 6 50fea92c4aa48a4a9e000099 Graffiti Report bui… TRUE batch Stre… #> 7 50fea6d54aa48a4a9e00002e Illegal Postings Report han… TRUE batch Stre… #> 8 518d564b601827e38800002d Blocked Pedestrian… NA TRUE batch Stre… #> 9 55e8409a45ff461f92000006 Encampment NA TRUE batch Stre… #> 10 518d5d52601827e3880001b1 Abandoned Vehicles Report a v… TRUE batch Park… #> # ℹ 11 more rows"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"requests","dir":"Articles","previous_headings":"Making requests","what":"Requests","title":"r311: An R interface to the open311 standard","text":"get data civic issues city area, run o311_requests. Using output o311_services, can narrow output requests. Open311 defines set standard parameters implemented endpoints. Using service_code parameter one previously returned service codes, complaints businesses illegally using shared spaces returned. Similarly, using service_request_id output, can retrieve single service request API.","code":"o311_requests() #> Simple feature collection with 50 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.5111 ymin: 37.74945 xmax: -122.3949 ymax: 37.79207 #> Geodetic CRS: WGS 84 #> # A tibble: 50 × 12 #> service_request_id status service_name service_code description #> #> 1 1020140726 open Abandoned Vehicles 518d5d52601… test #> 2 1020140725 open Park Requests 518d5cc9601… test #> 3 1020140302 open Street or Sidewalk Cleani… 518d5892601… Test - gar… #> 4 1020139578 open Street or Sidewalk Cleani… 518d5892601… Garbage on… #> 5 1020139514 open Encampment 55e8409a45f… NA #> 6 1020139513 closed Flooding, Sewer & Water L… 518d5c0d601… -- TEST MA… #> 7 1020139511 open Shared Spaces 6050cd8ce89… NA #> 8 1020139507 open Tree Maintenance 518d595d601… southbound… #> 9 1020139506 open Pothole & Street Issues 50fea9c24aa… southbound… #> 10 1020139505 closed Tree Maintenance 518d595d601… southbound… #> # ℹ 40 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # address , token , status_notes , media_url , #> # geometry o311_requests(service_code = \"6050cd8ce8961bbfa32bcf2c\") #> Simple feature collection with 50 features and 10 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.444 ymin: 37.75765 xmax: -122.3931 ymax: 37.79074 #> Geodetic CRS: WGS 84 #> # A tibble: 50 × 11 #> service_request_id status service_name service_code requested_datetime #> #> 1 1020139511 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-08T23:54:… #> 2 6405413 closed Shared Spaces 6050cd8ce8961bbfa… 2016-10-11T13:17:… #> 3 1020139479 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-05T22:52:… #> 4 1020139460 open Shared Spaces 6050cd8ce8961bbfa… 2023-12-01T17:20:… #> 5 1020139449 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-29T23:30:… #> 6 1020139418 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:53:… #> 7 1020139417 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:43:… #> 8 1020139414 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:31:… #> 9 1020139411 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-27T18:23:… #> 10 1020139392 open Shared Spaces 6050cd8ce8961bbfa… 2023-11-17T02:14:… #> # ℹ 40 more rows #> # ℹ 6 more variables: updated_datetime , address , token , #> # status_notes , description , geometry o311_request(\"1020139511\") #> Simple feature collection with 1 feature and 8 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.4183 ymin: 37.775 xmax: -122.4183 ymax: 37.775 #> Geodetic CRS: WGS 84 #> # A tibble: 1 × 9 #> service_request_id status service_name service_code requested_datetime #> #> 1 1020139511 open Shared Spaces 6050cd8ce8961bbfa3… 2023-12-08T23:54:… #> # ℹ 4 more variables: updated_datetime , address , token , #> # geometry "},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"bulk-queries","dir":"Articles","previous_headings":"Making requests","what":"Bulk queries","title":"r311: An R interface to the open311 standard","text":"Many endpoints define page limit meaning responses divided pages. query without parameters returns first page. Pagination can controlled page argument. control pagination, o311_request_all function can come handy. automatically iterates pages heuristically decides stop. following example retrieves data first two pages, resulting tibble 100 service requests.","code":"o311_request_all(max_pages = 2) #> Simple feature collection with 100 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -122.5111 ymin: 37.73277 xmax: -122.3931 ymax: 37.79207 #> Geodetic CRS: WGS 84 #> # A tibble: 100 × 12 #> service_request_id status service_name service_code description #> #> 1 1020140726 open Abandoned Vehicles 518d5d52601… test #> 2 1020140725 open Park Requests 518d5cc9601… test #> 3 1020140302 open Street or Sidewalk Cleani… 518d5892601… Test - gar… #> 4 1020139578 open Street or Sidewalk Cleani… 518d5892601… Garbage on… #> 5 1020139514 open Encampment 55e8409a45f… NA #> 6 1020139513 closed Flooding, Sewer & Water L… 518d5c0d601… -- TEST MA… #> 7 1020139511 open Shared Spaces 6050cd8ce89… NA #> 8 1020139507 open Tree Maintenance 518d595d601… southbound… #> 9 1020139506 open Pothole & Street Issues 50fea9c24aa… southbound… #> 10 1020139505 closed Tree Maintenance 518d595d601… southbound… #> # ℹ 90 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # address , token , status_notes , media_url , #> # geometry "},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"non-standard-parameters","dir":"Articles","previous_headings":"Making requests","what":"Non-standard parameters","title":"r311: An R interface to the open311 standard","text":"r311 implicitly supports API extensions introducing custom paths parameters. One API Klarschiff Rostock based CitySDK. Klarschiff CitySDK defines number non-default paths parameters extend filtering abilities open311 requests. Available parameters can usually found respective documentation (e.g. GitHub Klarschiff CitySDK). following query returns last 50 requests tagged “idea” keyword. custom parameters can also alter shape output. following example, query just count total requests using just_count parameter. result 1×1 tibble containing count value. CitySDK extensions also offers additional URL paths can queried using generic o311_query function.","code":"o311_api(\"Rostock\") tickets <- o311_requests(keyword = \"idea\", max_requests = 50) o311_requests(just_count = TRUE) #> # A tibble: 1 × 1 #> value #> #> 1 4094 poly <- o311_query(\"areas\") plot(poly$grenze) plot(tickets$geometry, add = TRUE, pch = 16)"},{"path":"https://jslth.github.io/r311/articles/r311.html","id":"cleanup","dir":"Articles","previous_headings":"","what":"Cleanup","title":"r311: An R interface to the open311 standard","text":"Endpoint data stored persistently sessions can create database open311 endpoints. database stored system’s user directory returned tools::R_user_dir(\"r311\"). reset database, run default back endpoints defined r311 remove endpoints manually added o311_add_endpoints.","code":"o311_reset_endpoints()"},{"path":"https://jslth.github.io/r311/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jonas Lieth. Author, maintainer, copyright holder.","code":""},{"path":"https://jslth.github.io/r311/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lieth J (2024). r311: R interface open311 standard. R package version 0.3.4, https://jslth.github.io/r311/, https://github.com/JsLth/r311, https://github.com/jslth/r311.","code":"@Manual{, title = {r311: R interface to the open311 standard}, author = {Jonas Lieth}, year = {2024}, note = {R package version 0.3.4, https://jslth.github.io/r311/, https://github.com/JsLth/r311}, url = {https://github.com/jslth/r311}, }"},{"path":"https://jslth.github.io/r311/index.html","id":"r311","dir":"","previous_headings":"","what":"R interface to the open311 standard","title":"R interface to the open311 standard","text":"r311 R interface international standard open311. Open311 APIs used civic issue management public service communication. standard allows administrations better manage citizen requests, citizens easily submit requests, (hence package) researchers data scientists access data regarding public service communication. r311 supports seamless management supplementation available endpoints, selection appropriate APIs access, retrieval civic service request data. Custom queries extensions (e.g. CitySDK) implicitly supported. r311 designed require minimal amount dependencies, allow easy integration common R frameworks tidyverse, sf xml2.","code":""},{"path":"https://jslth.github.io/r311/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R interface to the open311 standard","text":"can install development version open311 GitHub :","code":"# install.packages(\"remotes\") remotes::install_github(\"JsLth/r311\")"},{"path":"https://jslth.github.io/r311/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"R interface to the open311 standard","text":"following example loads r311, sets jurisdiction retrieves small amount data service tickets Cologne, Germany.","code":"library(r311) o311_api(\"Cologne\") o311_requests() #> Simple feature collection with 100 features and 11 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: 6.829609 ymin: 50.8609 xmax: 7.10357 ymax: 51.06044 #> Geodetic CRS: WGS 84 #> # A tibble: 100 × 12 #> service_request_id title description address_string service_name #> * #> 1 7748-2024 #7748-2024 Schrot… \"Schwarzer… 51067 Köln - … Schrott-Kfz #> 2 7775-2024 #7775-2024 Lichtm… \"Seit dem … 51105 Köln - … Lichtmast d… #> 3 7776-2024 #7776-2024 Lichtm… \"Seit dem … 51105 Köln - … Lichtmast d… #> 4 7777-2024 #7777-2024 Wilder… \"An der Ei… 50679 Köln - … Wilder Müll #> 5 7783-2024 #7783-2024 Straße… \"Baustelle… 50823 Köln - … Straßenbaus… #> 6 7795-2024 #7795-2024 Straße… \"Ergänzung… 50823 Köln - … Straßenbaus… #> 7 7817-2024 #7817-2024 Schrot… \"Hallo, \\r… 51147 Köln - … Schrott-Kfz #> 8 7824-2024 #7824-2024 Schrot… \"Hinteraus… 51065 Köln - … Schrottfahr… #> 9 7834-2024 #7834-2024 Fußgän… \"Gestern w… 51103 Köln - … Fußgängeram… #> 10 7838-2024 #7838-2024 Spiel-… \"Sehr geeh… Köln, Spiel- und … #> # ℹ 90 more rows #> # ℹ 7 more variables: requested_datetime , updated_datetime , #> # status , media_url , status_note , service_code , #> # geometry "},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Select an open311 API — o311_api","title":"Select an open311 API — o311_api","text":"Select open311 API attach active session. open311 API implementation open311 standard. consists endpoint name (e.g. city), root URL, jurisdiction ID. unambiguously identify API, can provide endpoint, jurisdiction ID, . input matched o311_endpoints select API. selected API available o311_* functions session terminated overwritten.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select an open311 API — o311_api","text":"","code":"o311_api(endpoint = NULL, jurisdiction = NULL, format = c(\"json\", \"xml\"))"},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select an open311 API — o311_api","text":"endpoint [character] Name endpoint runs open311 API. usually city, can provider open311 API. jurisdiction [character] ID jurisdiction served open311 API. jurisdiction ID usually root URL jurisdiction website, e.g. \"sfgov.org\" San Francisco. format [character] Response format. Must one \"json\" \"xml\". Defaults \"json\" simplification difficult unsafe xml2 objects. advisable use \"json\" whenever possible applicable. Additionally, \"xml\" requires xml2 package queries xmlconvert package simplification.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select an open311 API — o311_api","text":"list containing important information given jurisdiction, invisibly. list attached session can retrieved calling o311_api() without arguments.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select an open311 API — o311_api","text":"theory, several jurisdictions can exist single endpoints, e.g. region serves multiple jurisdictions. Similarly, multiple endpoints can exist single jurisdiction, e.g. provider set production test endpoints jurisdictions. Providing endpoint jurisdiction thus safe way identify API. default, handful endpoints supported. list currently supported endpoints, run o311_endpoints. can add non-default endpoints using o311_add_endpoint.","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_api.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select an open311 API — o311_api","text":"","code":"# cities are matched using regex o311_api(\"Cologne\") # passing a jurisdiction is more explicit o311_api(jurisdiction = \"stadt-koeln.de\") # calls without arguments return the current API o311_api() #> $name #> [1] \"Köln / Cologne, DE\" #> #> $root #> [1] \"https://sags-uns.stadt-koeln.de/georeport/v2/\" #> #> $docs #> NULL #> #> $jurisdiction #> [1] \"stadt-koeln.de\" #> #> $key #> [1] FALSE #> #> $pagination #> [1] TRUE #> #> $limit #> [1] 50 #> #> $json #> [1] TRUE #> #> $dialect #> [1] \"Mark-a-Spot\" #>"},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":null,"dir":"Reference","previous_headings":"","what":"API discovery — o311_discovery","title":"API discovery — o311_discovery","text":"Retrieve discovery information mounted endpoint.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"API discovery — o311_discovery","text":"","code":"o311_discovery()"},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"API discovery — o311_discovery","text":"list containing details given open311 API.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_discovery.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"API discovery — o311_discovery","text":"","code":"if (FALSE) { o311_api(\"zurich\") o311_discovery() }"},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":null,"dir":"Reference","previous_headings":"","what":"Endpoints — o311_add_endpoint","title":"Endpoints — o311_add_endpoint","text":"Modify examine defined open311 endpoints. o311_endpoints() retrieves list endpoints including additional information. o311_add_endpoint adds list define new endpoint can used queries. o311_reset_endpoints restores initial state endpoints list.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Endpoints — o311_add_endpoint","text":"","code":"o311_add_endpoint( name, root, jurisdiction = NULL, key = FALSE, pagination = FALSE, limit = NULL, json = TRUE, dialect = NULL ) o311_reset_endpoints() o311_endpoints(...)"},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Endpoints — o311_add_endpoint","text":"name [character] Name endpoint / city. name can arbitrary serves identification [o311_api]. root [character] Base URL endpoint sending production-grade requests. root URL commonly points \"georeport/v2/\". jurisdiction [character] Unique identifier jurisdiction. jurisdiction typically defined domain respective city website. optional endpoints serve one jurisdiction. key [logical] API key mandatory? pagination [logical] requests responses paginated? limit [integer] paginated, many requests one page contain? json [logical] JSON responses supported? FALSE, defaults \"XML\" responses. See also o311_api. dialect [character] open311 extension endpoint built . Common dialects include CitySDK, Connected Bits, SeeClickFix Mark--Spot. Currently, argument nothing, used future adjust response handling based dialect. ... List key-value pairs pair filter. key represents column value requested column value. keys must present column names o311_endpoints().","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Endpoints — o311_add_endpoint","text":"o311_endpoints, dataframe containing relevant information endpoint. o311_add_endpoint, new endpoint, invisibly. o311_reset_endpoints returns NULL invisibly. new endpoint duplicate, NULL returned invisibly.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Endpoints — o311_add_endpoint","text":"o311_endpoints() returns static list defined package installation directory. list contains limited number endpoints proven work time package development. include newer/smaller/less known endpoints test APIs. can manually added using o311_add_endpoint.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Endpoints — o311_add_endpoint","text":"function uses R_user_dir persistently store custom endpoints data sessions. set different directory, may use options(\"o311_user_dir\"). clean , run o311_reset_endpoints() deletes package-specific user directory defaults back system.file(\"endpoints.json\", package = \"r311\").","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_endpoints.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Endpoints — o311_add_endpoint","text":"","code":"# read default endpoints o311_endpoints() #> # A tibble: 62 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 52 more rows # get all endpoints powered by Connected Bits o311_endpoints(dialect = \"Connected Bits\") #> # A tibble: 7 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 2 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 3 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 4 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 5 Newport News, VA http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 6 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 7 San Francisco, … http… http… NA FALSE TRUE 50 TRUE Connec… # add a new endpoint o311_add_endpoint(name = \"test\", root = \"test.org/georeport/v2\") # read new endpoints o311_endpoints() #> # A tibble: 63 × 9 #> name root docs jurisdiction key pagination limit json dialect #> #> 1 Annaberg-Buchh… http… http… annberg-buc… FALSE TRUE 50 TRUE Mark-a… #> 2 Bloomington, IN http… NA bloomington… FALSE TRUE 1000 TRUE uReport #> 3 Bonn, DE http… http… bonn.de FALSE TRUE 100 TRUE Mark-a… #> 4 Boston, MA http… http… NA FALSE TRUE 50 TRUE Connec… #> 5 Brookline, MA http… http… brooklinema… FALSE TRUE 50 TRUE Connec… #> 6 Austin, TX http… http… NA FALSE TRUE 50 TRUE Connec… #> 7 Chicago, IL http… http… cityofchica… FALSE TRUE 50 TRUE Connec… #> 8 Newport News, … http… http… cityofnewpo… FALSE TRUE 50 TRUE Connec… #> 9 San Diego, CA http… http… sandiego.gov FALSE TRUE 50 TRUE Connec… #> 10 Köln / Cologne… http… NA stadt-koeln… FALSE TRUE 50 TRUE Mark-a… #> # ℹ 53 more rows # reset endpoints back to default o311_reset_endpoints()"},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":null,"dir":"Reference","previous_headings":"","what":"Is open311 API ok? — o311_ok","title":"Is open311 API ok? — o311_ok","text":"Checks whether open311 API mounted o311_api reachable returns valid requests response.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is open311 API ok? — o311_ok","text":"","code":"o311_ok(error = FALSE)"},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is open311 API ok? — o311_ok","text":"error [logical] Whether return logical error message describing API ok.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is open311 API ok? — o311_ok","text":"logical describing whether API reachable . error = TRUE, returns corresponding error object one occurs.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_ok.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is open311 API ok? — o311_ok","text":"","code":"if (FALSE) { # check if Bonn API is reachable o311_api(\"Bonn\") o311_ok() # check if Helsinki API is reachable - fails o311_add_endpoint( name = \"Helsinki\", root = \"asiointi.hel.fi/palautews/rest/v1/\" ) o311_api(\"Helsinki\") o311_ok() # return error message o311_ok(error = TRUE) }"},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Query an open311 endpoint — o311_query","title":"Query an open311 endpoint — o311_query","text":"Low-level function perform generic request API currently attached o311_api. open311 implementations support unique operations included official documentation. function can used access URL paths.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query an open311 endpoint — o311_query","text":"","code":"o311_query(path, ..., simplify = TRUE)"},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query an open311 endpoint — o311_query","text":"path Path appendix used access endpoint-specific operations. ... Additional query parameters. simplify Whether simplify output using jsonlite::toJSON(..., simplify = TRUE).","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query an open311 endpoint — o311_query","text":"parsed query output, either list dataframe.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query an open311 endpoint — o311_query","text":"can set options(r311_echo = TRUE) display requests sent using o311_query.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_query.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query an open311 endpoint — o311_query","text":"","code":"if (FALSE) { o311_api(\"rostock\") # manually query discovery o311_query(path = \"discovery\", simplify = FALSE) # query a custom path defined by the Klarschiff API o311_query(path = \"areas\") }"},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":null,"dir":"Reference","previous_headings":"","what":"Get civic service request data — o311_requests","title":"Get civic service request data — o311_requests","text":"Get civic service request data registered open311 endpoint. o311_request queries single service request ID. o311_requests queries single page service requests. o311_request_all tries iterate pages endpoint return complete dataset service requests.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get civic service request data — o311_requests","text":"","code":"o311_requests( service_code = NULL, start_date = NULL, end_date = NULL, status = NULL, page = NULL, ... ) o311_request(service_request_id, ...) o311_request_all( service_code = NULL, start_date = NULL, end_date = NULL, status = NULL, ..., max_pages = Inf, progress = TRUE )"},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get civic service request data — o311_requests","text":"service_code [character] IDs service types queried. Defaults available codes endpoint. list available service codes can retrieved using o311_services. start_date, end_date [POSIXt] Start date end date query results. Must date-time objects. specified, defaults last 90 days. status [character] Status public service ticket. Can one \"open\" \"closed\". NULL, returns types tickets. page [integer] Page response. endpoints paginate responses way limited number tickets returned query. retrieve data, consider using o311_request_all. ... endpoint-specific parameters documented respective endpoint reference. service_request_id [character] Identifier single service request. Request IDs can usually retrieved o311_requests. max_pages [integer] Number pages search result returned. progress [logical] Whether show waiter indicating current page iteration.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get civic service request data — o311_requests","text":"dataframe containing data civic service requests. dataframe can contain varying columns depending open311 implementation.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get civic service request data — o311_requests","text":"o311_request_all applies number checks determine stop searching. First, many endpoints return error last page exceeded. Thus, last page request failed, break. Second, exceeding pagination limit return error, response compared previous response. identical, response discarded previous responses returned. Finally, page exceeds max_pages, responses point returned. open311 leaves space endpoints implement request parameters. parameters can provided using dot arguments. arguments validated pre-processed. Date-time objects must formatted according w3c standard. common parameters include: q: Perform text search across requests. update_after/updated_before: Limit request according request update dates. per_page: Specifiy maximum number requests per page. extensions: Adds nested attribute \"extended_attributes\" response. long/lat/radius: Searches requests fixed radius around coordinate. dot arguments deviate open311 standard, guaranteed available every endpoint might removed without notice. Refer endpoint docs learn custom parameters (o311_endpoints()$docs).","code":""},{"path":[]},{"path":"https://jslth.github.io/r311/reference/o311_requests.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get civic service request data — o311_requests","text":"","code":"if (FALSE) { o311_api(\"chicago\") # retrieve requests from the last two days now <- Sys.time() two_days <- 60 * 60 * 24 * 2 o311_requests(end_date = now, start_date = now - two_days) # retrieve only open tickets tickets <- o311_requests(status = \"open\") # request the first ticket of the previous response o311_request(tickets$service_request_id[1]) # request all data o311_request_all() # request data of the first 5 pages o311_request_all(max_pages = 5) }"},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":null,"dir":"Reference","previous_headings":"","what":"Get service list — o311_services","title":"Get service list — o311_services","text":"Get list available services. Services unique endpoint / city thus require attached jurisdiction using o311_api.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get service list — o311_services","text":"","code":"o311_services(...) o311_service(service_code, ...)"},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get service list — o311_services","text":"... endpoint-specific parameters documented respective endpoint reference. service_code Identifier single service definition. Service codes can usually retrieved o311_services.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get service list — o311_services","text":"dataframe list containing information service.","code":""},{"path":"https://jslth.github.io/r311/reference/o311_services.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get service list — o311_services","text":"","code":"if (FALSE) { # set up a jurisdiction o311_add_endpoint( name = \"helsinki test\", root = \"https://dev.hel.fi/open311-test/v1/\" ) o311_api(\"helsinki test\") # get a list of all services services <- o311_services() # get a service list in finnish # the locale parameter is specific to the Helsinki API o311_services(locale = \"fi_FI\") # inspect a service code o311_service(services$service_code[1]) }"},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate endpoints — validate_endpoints","title":"Validate endpoints — validate_endpoints","text":"Checks whether endpoints correctly defined, reachable, /valid. Iterates endpoints defined o311_endpoints returns status along reason, applicable.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate endpoints — validate_endpoints","text":"","code":"validate_endpoints( idx = NULL, checks = c(\"discovery\", \"services\", \"requests\"), methods = c(\"formal\", \"down\", \"valid\") )"},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate endpoints — validate_endpoints","text":"idx Index numbers endpoints check. Index numbers follow row numbers o311_endpoints. checks open311 method check. default, checks methods. methods checks apply. formal checks whether endpoint uniquely identifiable given names jurisdictions o311_endpoints. checks whether endpoint reachable ready requests. valid checks whether method returns valid output, .e. list dataframe 0 rows/elements. default, applies methods.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate endpoints — validate_endpoints","text":"dataframe containing name endpoint, one three columns check results, one three columns reasons check turned negative.","code":""},{"path":"https://jslth.github.io/r311/reference/validate_endpoints.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate endpoints — validate_endpoints","text":"","code":"if (FALSE) { # check all endpoints and methods validate_endpoints() # check only requests validate_endpoints(checks = \"requests\") # check only if an endpoint is down validate_endpoints(checks = \"down\") }"},{"path":"https://jslth.github.io/r311/news/index.html","id":"r311-031","dir":"Changelog","previous_headings":"","what":"r311 0.3.1","title":"r311 0.3.1","text":"Initial CRAN submission.","code":""}]