{"id":13436768,"url":"https://github.com/datasciencecampus/propeR","last_synced_at":"2025-03-18T21:31:04.308Z","repository":{"id":104837303,"uuid":"209261254","full_name":"datasciencecampus/proper","owner":"datasciencecampus","description":"A repository for the R tool propeR, which analyses travel time and cost using an OTP graph (see datasciencecampus/graphite)","archived":false,"fork":false,"pushed_at":"2020-05-29T09:16:23.000Z","size":29237,"stargazers_count":16,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-15T19:37:14.905Z","etag":null,"topics":["docker","dsc-projects","opentripplanner","otp","r","transport","travel"],"latest_commit_sha":null,"homepage":"https://datasciencecampus.github.io/proper/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datasciencecampus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-09-18T08:45:31.000Z","updated_at":"2024-10-14T01:10:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf6116ae-9b66-4e56-9648-990a47c1e77e","html_url":"https://github.com/datasciencecampus/proper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasciencecampus%2Fproper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasciencecampus%2Fproper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasciencecampus%2Fproper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasciencecampus%2Fproper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datasciencecampus","download_url":"https://codeload.github.com/datasciencecampus/proper/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244310512,"owners_count":20432552,"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":["docker","dsc-projects","opentripplanner","otp","r","transport","travel"],"created_at":"2024-07-31T03:00:51.982Z","updated_at":"2025-03-18T21:30:59.299Z","avatar_url":"https://github.com/datasciencecampus.png","language":"HTML","funding_links":[],"categories":["deploy dashboards"],"sub_categories":["propeR"],"readme":"# p r o p e R\n\n**prope** [latin] _verb_\n**Definitions:**\n1. near, nearby;\n2. almost;\n3. close by\n\n\u003cp align=\"center\"\u003e\u003cimg align=\"center\" src=\"proper/meta/logo/propeR_logo_v1.png\" width=\"200px\"\u003e\u003c/p\u003e\n\n## Contents\n\n* [Introduction](#introduction)\n* [Software Prerequisites](#software-prerequisites)\n* [Installing propeR](#installing-proper)\n  * [R installation](#r-installation)\n  * [Docker installation](#docker-installation)\n* [Running propeR](#running-proper)\n  * [Data prerequisites](#data-prerequisites)\n  * [Using R](#using-rstudio)\n  * [Using Docker](#using-docker)\n* [FAQ](#faq)  \n* [Acknowledgments](#acknowledgments)  \n* [Contributions and Bug Reports](#contributions-and-bug-reports)  \n* [Licence](#licence)  \n\n\n## Introduction\n\nThis R package ([propeR](https://github.com/datasciencecampus/proper)) was created to analyse multimodal transport for a number of research projects at the [Data Science Campus, Office for National Statistics](https://datasciencecampus.ons.gov.uk/). This repository is for the installation and use of propeR only, for all OTP graph related guidance, please see [graphite](https://github.com/datasciencecampus/graphite).\n\n## Software Prerequisites\n\n* [R](https://www.r-project.org/) and your GUI of choice, such as [RStudio](https://www.rstudio.com/), OR\n* [Docker](https://www.docker.com/)\n\n## Installing propeR\n\n### R installation\n\nThe easiest method is to install direct from this GitHub repository using:\n\n```\nlibrary(devtools)\ninstall_github(\"datasciencecampus/propeR/propeR\")\n```\n\nFailing this, you can pull this repository and install locally using:\n\n```\ninstall(\"path/to/propeR/dir\")\n```\n\n#### R building\n\nIf neither method above works. Or you wish to make changes to the package. Then you will need to build the package. Building propeR requires devtools and roxygen2:\n\n```\n# R\ninstall.packages(\"devtools\")\ninstall.packages(\"roxygen2\")\n```\n\nThen:\n\n```\nbuild(\"path/to/propeR/dir\")\ninstall(\"path/to/propeR/dir\")\n```\n\nOnce you have installed propeR using RStudio you can now [start using it in RStudio](#using-rstudio).\n\n### Docker installation\n\nFor those who want to run propeR through Docker, we have created a Docker image. The propeR R package can be built from the parent directory as follows:\n\n```\ncd path/to/propeR/dir\ndocker build . --tag=dsc_proper\n```\n\nOr you can build from the [online docker image](https://hub.docker.com/u/datasciencecampus), using:\n\n```\ndocker run datasciencecampus/dsc_proper:1.0\n```\n\nSee [Dockerfile](Dockerfile) for more information and dependencies. Once you have installed propeR using Docker you can now [start using it in Docker](#using-docker).\n\n## Running propeR\n\nFunction examples are [available in this example.md file](https://github.com/datasciencecampus/proper/tree/develop/example.md).\n\n### Data prerequisites\n\nAll location data (origin and destination) must be in comma separated (CSV) format and contain the following columns:\n* A unique ID column\n* A latitude column, where data is in decimal degrees (or a postcode column)\n* A longitude column, where data is in decimal degrees (or a postcode column)\n\nThe CSV file must contain headers, the header names can be specified in **`importLocationData()`**.\n\n### Using RStudio\n\nAs with any R package, it can be loaded in an R session using:\n\n```\n#R\nlibrary(propeR)\n```\n\nThen you can use the functions, such as:\n\n```\n#R\npointToPoint(\noutput.dir=\"path/to/output/dir\", \noriginPoints=originPointsdf, \ndestinationPoints=destinationPointsdf, \nstartDateAndTime=\"2019-08-02 12:00:00\"\n)\n```\n\nOutputs will be saved to `path/to/output/dir`.\n\n### Using Docker\n\nAlternatively. If you have installed propeR using Docker you can use Docker to run propeR. Put source and destination `.csv` data in a directory, e.g., `/tmp/data/`. Example data files `origin.csv` and `destination.csv` can be found in `propeR/inst/extdata/`, then:\n\n```\ndocker run -v path/to/output/dir:/mnt datasciencecampus/dsc_proper:1.0 'otp.host=\"XXX.XXX.X.X\", fun=\"pointToPoint\", src_file=\"/mnt/origin.csv\", dst_file=\"/mnt/destination.csv\", output.dir=\"/mnt\", startDateAndTime=\"2019-08-02 12:00:00\"'\n```\n\nwhere `otp.host` is your inet address, which can be found using:\n\n```\n/sbin/ifconfig |grep inet |awk '{print $2}'\n\n```\n\nOutput data will be in `path/to/output/dir`.\n\n\n## FAQ\n\nQ: How accurate is the cost calculation in the point to point functions?\n\n\u003eA: The tool currently cannot ingest fare information. Therefore `costEstimate` can be used in the point to point functions. This provides an *estimate* based on the values given in the parameters `busTicketPrice`, `busTicketPriceMax`, `trainTicketPriceKm` and `trainTicketPriceMin`.\n\nQ: How to I stop propeR printing to the R console:\n\n\u003eA: All functions have a parameter called `infoPrint`. This by default is set to `T`, please set to `F` if you want to prevent console printing.\n\nQ: I found a bug!\n\n\u003eA: Please use the [GitHub issues](https://github.com/datasciencecampus/proper/issues) form to provide us with the information.\n\n### Common errors\n\nQ: Why am I receiving the following error when running propeR?\n\n```\nError in curl::curl_fetch_memory(url, handle = handle) :\n  Failed to connect to localhost port 8080: Connection refused\nCalled from: curl::curl_fetch_memory(url, handle = handle)\n```\n\n\u003e A: The OTP server has not been initiated. Please see [graphite](https://github.com/datasciencecampus/graphite) of this guide.\n\nQ: Why am I receiving the following error when running propeR?\n\n```\nError in paste0(otpcon, \"/plan\") : object 'otpcon' not found\n```\n\n\u003e A: The OTP connection has not been established. Please see [graphite](https://github.com/datasciencecampus/graphite) of this guide.\n\n## Acknowledgments\n\n* [TransXChange2GTFS](https://github.com/danbillingsley/TransXChange2GTFS)\n* [transxchange2gtfs](https://github.com/planarnetwork/transxchange2gtfs)\n* [dtd2mysql](https://github.com/open-track/dtd2mysql)\n* [OpenTripPlanner](http://www.opentripplanner.org/)\n* functions `otpConnect()`, `otpTripTime()`, `otpTripDistance()`, `otpIsochrone()` are modified from Marcus Young's repo [here](https://github.com/marcusyoung/opentripplanner/blob/master/Rscripts/otp-api-fn.R). Permission to use Marcus Young's code can be found here: https://github.com/marcusyoung/opentripplanner/pull/15\n\n## Authors / Contributors\n\n#### Data Science Campus - Office for National Statistics\n* [Michael Hodge](https://github.com/mshodge)\n* [Phillip Stubbings](https://github.com/phil8192)\n* [Ioannis Tsalamanis](https://github.com/IoannisTsalamanis)\n\n## Contributions and Bug Reports\n\nWe welcome contributions and bug reports. Please do this on this repo and we will endeavour to review pull requests and fix bugs in a prompt manner.\n\nBuilt and tested on OS and Windows using R version 3.5.2.\n\n## Licence\n\nThe Open Government Licence (OGL) Version 3\n\nCopyright (c) 2018 Office of National Statistics\n\nThis source code is licensed under the Open Government Licence v3.0. To view this licence, visit [www.nationalarchives.gov.uk/doc/open-government-licence/version/3](www.nationalarchives.gov.uk/doc/open-government-licence/version/3) or write to the Information Policy Team, The National Archives, Kew, Richmond, Surrey, TW9 4DU.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasciencecampus%2FpropeR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatasciencecampus%2FpropeR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasciencecampus%2FpropeR/lists"}