Generating Pmml code for data calculations in R

106 Views Asked by At

I am generating some derived fields from a data set given to me. Below is an example of one such derived field. I am calculating age from birth date. Is there a way to generate pmml code for such calculations.

age <- as.numeric(format(Sys.Date(), "%Y")) - as.numeric(format(as.Date(birth_date, "%m/%d/%Y"), "%Y"))

1

There are 1 best solutions below

0
On

You should check out PMML built-in functions dateDaysSinceYear and dateSecondsSinceYear.