Learn R Programming

rbi.helpers (version 0.4.0)

split_unit: Split a unit string

Description

Splits a unit string (e.g., "2 weeks") into the amount (2) and unit ("weeks")

Usage

split_unit(unit_string)

Value

a list with two elements, "num" (the amount) and "unit", , for use with lubridate::period

Arguments

unit_string

the string to split

Author

Sebastian Funk