powered by
Functions to make the interface easier and more intuitive to use - they convert numeric edgeweights (e.g. 900) to character strings (e.g. "15min"), and vice versa.
numericEdgeWeight(edgeWeight, type)prettyEdgeWeight(edgeWeight, type)
prettyEdgeWeight(edgeWeight, type)
A time or distance, in numeric or string form.
Either 'time' or 'distance'.
Either a numeric or formatted edgeweight
# NOT RUN { numericEdgeWeight("1hr 30m", "time") # 5400 numericEdgeWeight("1ml", "distance") # 1609 prettyEdgeWeight(1245, "time") # 30min 45s prettyEdgeWeight(1245, "distance") # 1km 245m # }
Run the code above in your browser using DataLab