{"id":23372905,"url":"https://github.com/urbananalyst/paris-bikes","last_synced_at":"2025-04-08T02:49:23.816Z","repository":{"id":77960071,"uuid":"534356554","full_name":"UrbanAnalyst/paris-bikes","owner":"UrbanAnalyst","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-09T15:42:31.000Z","size":11487,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T02:19:21.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://UrbanAnalyst.github.io/paris-bikes","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UrbanAnalyst.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-09-08T19:05:39.000Z","updated_at":"2023-11-20T23:40:14.000Z","dependencies_parsed_at":"2023-02-24T10:30:24.714Z","dependency_job_id":null,"html_url":"https://github.com/UrbanAnalyst/paris-bikes","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"7d65617baa1540e8eaadaadf20ad45c8ff7e95d1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fparis-bikes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fparis-bikes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fparis-bikes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fparis-bikes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UrbanAnalyst","download_url":"https://codeload.github.com/UrbanAnalyst/paris-bikes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767259,"owners_count":20992541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T16:51:18.610Z","updated_at":"2025-04-08T02:49:23.792Z","avatar_url":"https://github.com/UrbanAnalyst.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n[![R build\nstatus](https://github.com/UrbanAnalyst/paris-bikes/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/paris-bikes/actions?query=workflow%3AR-CMD-check)\n[![Project Status: Concept](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)\n\nTool to estimate bicycle flows throughout the network of metropolitan Paris, France.\n\n## How?\n\nStart by installing and loading the package:\n\n```{r load, eval = FALSE}\nremotes::install_github (\"UrbanAnalyst/paris-bikes\")\nlibrary (parisbikes)\n```\n\nThen just two steps. First, get the street network of Paris (or anywhere) from Open Street Map.\n\n```{r get-network, eval = FALSE}\npath \u003c- \"\u003clocal\u003e/\u003cdirectory\u003e/\u003cfor\u003e/\u003cparis\u003e/\u003cdata\u003e\"\npb_get_network (location = \"Paris France\", path)\n```\n\nThat function will create a file called \"paris-sc.Rds\" in the location\nspecified by \"path\". Then load the resultant network and use that to calculate\ncentrality:\n\n```{r centrality, eval = FALSE}\ndat \u003c- readRDS (\"/\u003cpath\u003e/\u003cto\u003e/paris-sc.Rds\")\nnetwork \u003c- pb_centrality (dat, mode = \"bicycle\")\n```\n\nIt is also possible to calculate centrality including the effects of elevation\nchanges, by specifying an additional \"elev_file\" parameter as the path to a\nlocal 'geotiff' elevation file. See the function documentation of\n`pb_centrality` for details.\n\n## Visualising the results\n\nThe following code can be used to visualise the resultant network centrality,\nusing [the `mapdeck` package](https://symbolixau.github.io/mapdeck/index.html)\n(which first requires an API token, as explained in the documentation). The\nfollowing code rescales the centrality measures using a value of 3.71 derived\nelsewhere to optimally match observed distributions of cycling densities in\nParis.\n\n```{r viz, eval = FALSE}\nindex \u003c- which (network$centrality \u003e 0)\nnetwork \u003c- dodgr::merge_directed_graph (network [index, ])\nnetwork$flow \u003c- network$centrality / max (network$centrality)\nnetwork$flow \u003c- network$flow ^ (1 / 3.71)\nnetwork$width \u003c- 5 * network$flow\n```\n\nThe following lines will then open an interactive visualization of the flow\ndensities throughout Paris.\n\n```{r mapdeck, eval = FALSE}\nlibrary (mapdeck)\nmapdeck (style = mapdeck_style ()) %\u003e%\n    add_line (net, \n              origin = c (\".vx0_x\", \".vx0_y\"),\n              destination = c (\".vx1_x\", \".vx1_y\"),\n              stroke_colour = \"flow\",\n              stroke_width = \"width\",\n              stroke_opacity = \"flow\",\n              palette = \"matlab_like2\",\n              legend = TRUE)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbananalyst%2Fparis-bikes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbananalyst%2Fparis-bikes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbananalyst%2Fparis-bikes/lists"}