Learn R Programming

Biograph (version 2.0.6)

age_as_year: Converts a vector of ages to decimal year (calendar year and fraction of year).

Description

Converts a vector of ages (class 'numeric') to calendar years and fractions of year. The function needs dates of births.

Usage

age_as_year(x,born,format.born)

Arguments

x
vector of ages
born
vector of dates of birth (class 'Date')
format.born
format of birth dates

Value

year
Calendar year and fraction of year

Examples

Run this code
	age_as_year(23,"1990-10-30","%Y-%m-%d")

Run the code above in your browser using DataLab