Learn R Programming

Biograph (version 2.0.6)

Date_as_age: Converts a vector of dates (class 'Date') to ages.

Description

Converts a vector of dates (class 'Date') to ages. Function needs birth dates.

Usage

Date_as_age (x,format.in,born)

Arguments

x
Vector of dates of class 'Date'
format.in
date format
born
Vector of dates of birth. Birth dates have the same format as the other dates.

Value

age.sec
Age in seconds
age.day
Age in days
age
Age in years, months and days (produced by package lubridate)
age.year
Age in decimal year

Examples

Run this code
	Date_as_age ("2010-10-30","%Y-%m-%d","1990-4-20")

Run the code above in your browser using DataLab