date_convert: Converts vector of dates from one format to another

Description Usage Arguments Value Author(s) Examples

Description

Converts dates at transition to dates in another format or to ages

Usage

1
date_convert(d,format.in,selectday,format.out,born,format.born)

Arguments

d

A vector of dates to be converted

format.in

Format of input date

selectday

If input date is in CMC, selectday gives the day of the month. Default is 1

format.out

Format of output date

born

Date of birth for computation of age. Format the date of birth is format.in. May be omitted, unless date at transition need to be converted to age

format.born

Format of date of birth

Value

date

Dates at transition. Object of class 'Date'(number of days since 1970-01-01)

datep

Dates for printing

Author(s)

Frans Willekens

Examples

1
2
3
4
5
6
7
    data(GLHS)
    b <- date_convert(d='01/01/2011',format.in='%m/%d/%Y',selectday=1,format.out='day-month-year')  
    dd <- GLHS$marriage
    fo <- 'day-mon-year'
    gb <- GLHS$born
    bb<- date_convert(d=dd,format.in="CMC",selectday=1,format.out=fo,born=gb,format.born="CMC")
    

Biograph documentation built on May 1, 2019, 8:48 p.m.