Miles Mathis' Charge Field
Would you like to react to this message? Create an account in a few clicks or log in to continue.

R package convertr

Go down

R package convertr Empty R package convertr

Post by Cr6 Mon Oct 09, 2017 8:52 pm

Might come in handy....
---
https://github.com/ropenscilabs/convertr


An R package for converting things to other things. The package is not on CRAN but can be installed using:

install.packages("devtools")
devtools::install_github("GShotwell/convertr")

The package contains one function which converts numerical vectors from one unit to another. Data on conversion factors comes from the POSC Units of Measure Dictionary v2.2 and Wikipedia.

convert(1:20, "kg", "g")
convert(1:20, "sq yd", "km2")

#This will produce an error:
convert(1:20, "kg", "km2)

Units are converted using a lookup table, based on the POSC dictionary. You can explore this table using the explore_units() function. This function launches a shiny app.

Figuring out which units can be converted to each other can be tricky, so convertr comes with an an shiny gadget to help you build valid convert() expressions. This can be accesed either by calliing convert_gadget() or through the addin menu. To access the addin make sure you are using a recent version of RStudio.

Cr6
Admin

Posts : 1178
Join date : 2014-08-09

https://milesmathis.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum