conv_wgt: Convert weights

Description Usage Arguments Details Examples

Description

Convert weight from different formats/measurements into lbs

Usage

1
conv_wgt(wgt, regex = NULL, from = "st", round = 0)

Arguments

wgt

vector of weights to be converted, see examples.

regex

specific regular expression to split wgt by (if wgt is a character string representing stones and lbs)

from

convert from "kg" to lbs, if wgt is numeric

round

round weight to nearest

Details

Converts a numeric weight from kilograms ("kg") or stones ("st") into lbs. It also converts a character string of stones and lbs, ie. 9-7 representing 9 stone 7 lbs, into lbs using regex.

Examples

1
2
3
4
5
6
7
8
## Not run: 
wgts <- c("9-7", "9-0", "11-8")
conv_wgt(wgt = wgts)

wgts <- c(57, 58, 59)
conv_wgt(wgt = wgts, from = "kg")

## End(Not run)

durtal/RcappeR documentation built on May 15, 2019, 6 p.m.