Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit-aware arguments to ors_isochrones() #51

Open
aoles opened this issue May 9, 2019 · 0 comments
Open

Unit-aware arguments to ors_isochrones() #51

aoles opened this issue May 9, 2019 · 0 comments
Assignees
Labels
💡 enhancement New feature or request

Comments

@aoles
Copy link
Member

aoles commented May 9, 2019

Leverage the units package for assigning units to variables provided to arguments such as ranges or intervals to e.g. ors_isochrones() and for doing the conversion from hours/minutes to the internal representation in seconds. Based on unit type (time vs. distance) appropriate range_type could be chosen, see also measurements.

library(units)
#> udunits system database from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/units/share/udunits

x <- set_units(20, "min")
x
#> 20 [min]

units(x) <- "secs"
x
#> 1200 [s]

library(measurements)
conv_unit_options$duration
#>  [1] "nsec" "usec" "msec" "sec"  "min"  "hr"   "day"  "wk"   "mon"  "yr"  
#> [11] "dec"  "cen"  "mil"  "Ma"

Created on 2019-05-09 by the reprex package (v0.2.1)

@aoles aoles added the 💡 enhancement New feature or request label May 9, 2019
@aoles aoles self-assigned this May 9, 2019
@aoles aoles changed the title Use units-aware varaibles Use units-aware variables May 9, 2019
@aoles aoles changed the title Use units-aware variables Unit-aware arguments to ors_isochrones() May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant