p_age: parse age

Description Usage Arguments Details Value Examples

View source: R/p_age.R

Description

parse age formatted as 34Y, 12M, 20D, etc. to an age in years

Usage

1
p_age(x)

Arguments

x

character; age represented as numeric with a Y, M, D suffic

Details

Parses a character string to yield an age in years.

Value

numeric age in years

Examples

1
2
3
4
  
  c( '25', '34Y', '11 M', '12d', '25 w' ) %>% p_age           
  1:5 %>% p_age
  

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