Learn R Programming

JumpeR (version 0.3.0)

metric_conversion: Formatting feet-inches lengths as meters

Description

Takes a character string (or list) representing a length in feet-inches format (e.g. "12-07.45") and converts it to a distance in meters ("3.85m").

Usage

metric_conversion(x)

Arguments

x

A character vector of distance(s) in feet-inches format (e.g. "12-07.45"), to be converted to meters ("3.85m")

Value

returns the value of the string x which represents a distance in meters, as a character, with unit "m" included

Examples

Run this code
# NOT RUN {
distances <- c("1.23m", "5-02.34", "43.45", "6.89", NA)
metric_conversion(distances)
math_format(metric_conversion(distances))
metric_conversion("5.45m")
# }

Run the code above in your browser using DataLab