strip_units: Strip unit-like characters from a vector

Description Usage Arguments Value Note Examples

View source: R/strip_units.R

Description

Strip everything after the first set of number like items

Usage

1

Arguments

x

vector, usually character.

Value

A vector of the same class as x, but with the trailing non-number elements removed. It does not perform a coercion.

Note

consider adding an as parameter to perform coercions. See 2nd example for comma left in.

Examples

1
2
  strip_units( '32 ft/s^2')
  strip_units( '1,001 nights' )

decisionpatterns/coercion documentation built on Nov. 4, 2019, 10:23 a.m.