gmapsdistance

Interface Between R and Google Maps

https://github.com/jlacko/gmapsdistance

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary

Keywords

r spatial
Last synced: 6 months ago · JSON representation

Repository

Interface Between R and Google Maps

Basic Info
  • Host: GitHub
  • Owner: jlacko
  • License: gpl-3.0
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 203 KB
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 3
  • Open Issues: 2
  • Releases: 1
Fork of rodazuero/gmapsdistance
Topics
r spatial
Created almost 4 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Code of conduct

README.md

gmapsdistance

R-CMD-check Downloads-monthly Downloads-total License CRAN_Status_Badge CRAN-checks Codecov test coverage

Interface Between R and Google Maps

The function gmapsdistance uses the Google Maps Distance Matrix API to compute the distance(s) and time(s) between two points or two vectors of points using one of the four defined modes of transportation: bicycling, walking, driving, transit. The distance is returned in meters and the time in seconds.

An API key is necessary to perform the query. Google maps must be able to find both the origin and the destination in order for the function to run.

While the R package is open source the Distance Matrix API itself is a commercial service, requiring registration in all cases.

A free tier is provided - $200 monthly credit. This is enough for 40,000 Distance Matrix calls or 20,000 Distance Matrix Advanced calls – more than sufficient for most R package users.

Also note that using the API is subject to Google Maps Platform Terms of Service.

Installation

```r

CRAN install / stable version

install.packages("gmapsdistance")

Github installation / current dev version

remotes::install_github("jlacko/gmapsdistance") ```

Examples of use

In this example we will compute the driving distance between Washington DC, and New York City. The code returns the Time, the Distance and the Status of the query (OK if it was successful).

``` r results <- gmapsdistance(origin = "Washington DC", destination = "New York City NY", mode = "driving", key = Sys.getenv("GOOGLEAPIKEY")) # your actual API key comes here... results

$Time

[1] 14523

$Distance

[1] 367656

$Status

[1] "OK"

```

This example computes distance matrix between two vectors of cities at a specific departure time. The code displays resulting distance matrices using time (in seconds) and travel distance (in meters) as metrics.

``` r results <- gmapsdistance(origin = c("Washington DC", "New York NY", "Seattle WA", "Miami FL"), destination = c("Washington DC", "New York NY", "Seattle WA", "Miami FL"), mode = "bicycling", depdate = "2022-05-31", # provided as string in ISO 8601 format deptime = "12:00:00", # provided as string in HH:MM:SS format key = Sys.getenv("GOOGLEAPIKEY")) # your actual API key comes here...

results$Time

Washington DC New York NY Seattle WA Miami FL

Washington DC 0 76753 893416 353377

New York NY 76537 0 917724 429533

Seattle WA 890818 922255 0 1045150

Miami FL 350851 427721 1048150 0

results$Distance

Washington DC New York NY Seattle WA Miami FL

Washington DC 0 388695 4762468 1919628

New York NY 384224 0 5028313 2303263

Seattle WA 4754835 5049618 0 5638340

Miami FL 1909272 2298117 5651681 0

```

Usage limits

There are a set of limits to the number of calls that can be done. These limits are established by the Google Maps Distance Matrix API

License

GNU General Public License v3.0

How to contribute

We encourage any kind of suggestions to improve the quality of this code. You can submit pull requests indicating clearly what is the purpose of the change and why we should accept such pull request. Although not necessary, we encourage you to verify that your suggestions are in accordance with the general guidelines established in the CRAN repository by running the R CMD check command.

Code of conduct

Please see the file CODEOFCONDUCT.md for the Code of Conduct for the Contributor Covenant Code of Conduct.

Authors

This code was developed originally by Rodrigo Azuero and David Zarruk.

It is currently maintained by Jindra Lacko.

AUTHORS.md have a list of everyone who have contributed to gmapsdistance.

Where has gmapsdistance be used/mentioned.

We like to keep track of the projects where gmapsdistance has been used. This will help us identify how to better improve the code. Let us know if you use gmapsdistance! Below you will find links to some of the projects and some of the references to gmapsdistance that we have found.

  1. Proximity to pediatric cardiac specialty care for adolescents with congenital heart defects. Link to article.

  2. Measuring Accessibility to Rail Transit Stations in Scarborough: Subway vs. LRT. Link to article

  3. Social Data Science Course. University of Copenhagen. Department of Economics. Link

  4. R-bloggers. The collaborative innovation landscape in data science. Link

  5. RPubs. Link

  6. Identifying Partnership Opportunities at Air Force Installations: A Geographic Information Systems Approach Link

  7. DataWookie. Review of gmapsdistance. Link

  8. The Role of Telehealth in Promoting Equitable Abortion Access in the United States: Spatial Analysis Link to article

  9. The relationship between living in urban and rural areas of Scotland and children’s physical activity and sedentary levels: a country-wide cross-sectional analysis Link to article

  10. E-trikes for urban delivery: An empirical mixed-fleet simulation approach to assess city logistics sustainability Link to article

Owner

  • Name: Jindra Lacko
  • Login: jlacko
  • Kind: user
  • Location: Prague, Czech Republic

#rstats fanboy. Has a database and is not afraid to use it!

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 11
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 11

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 216
  • Total Committers: 9
  • Avg Commits per committer: 24.0
  • Development Distribution Score (DDS): 0.403
Past Year
  • Commits: 4
  • Committers: 2
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.25
Top Committers
Name Email Commits
Rodrigo Azuero r****o@g****m 129
Jindra Lacko j****o@g****m 56
Demetrio Rodriguez D****T@g****m 16
Jan Tilly j****y@g****m 5
David Zarruk Valencia d****k@g****m 3
Jindra Lacko j****a@j****t 3
Michael Chirico m****4@g****m 2
Michael Chirico M****4@g****m 1
Nick Janetos n****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 3
  • Average time to close issues: about 21 hours
  • Average time to close pull requests: 10 minutes
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 3.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jlacko (2)
  • mhpob (1)
  • shahronak47 (1)
  • stinkins (1)
  • tle4336 (1)
Pull Request Authors
  • jlacko (3)
Top Labels
Issue Labels
question (1) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 457 last-month
  • Total docker downloads: 29
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
cran.r-project.org: gmapsdistance

Distance and Travel Time Between Two Points from Google Maps

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 457 Last month
  • Docker Downloads: 29
Rankings
Forks count: 17.8%
Downloads: 23.3%
Average: 27.6%
Dependent packages count: 29.8%
Stargazers count: 31.7%
Dependent repos count: 35.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • RCurl * imports
  • XML * imports
  • methods * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests