timriffe / DemoTools

Tools for the evaluation, adjustment, and standardization of demographic data
https://timriffe.github.io/DemoTools
Other
59 stars 31 forks source link

basepop_five() alternate default DatesIn #183

Closed peterdavjohnson closed 3 years ago

peterdavjohnson commented 3 years ago

I don't understand the reasons for some of the default xxxDatesIn values, and why they are different for nLx and Asfr.

From Help:

nLxDatesIn
A vector of numeric years (for example, 1986). The dates which pertain to the columns in nLxFemale and nLxMale. If not provided, the function automatically determines two dates which are 8 years before refDate and 0.5 years after refDate.

AsfrDatesIn A vector of numeric years (for example, 1986). These are the dates which pertain to the columns in AsfrMat. If not provided, the function automatically determines two dates which are 8 years before refDate and 0.5 before refDate.

If the dates aren't specified the defaults are used: line 565: nLxDatesIn <- c(abs(8 - refDate), refDate + 0.5)

line 572: AsfrDatesIn <- abs(c(8, 0.5) - refDate)

I would in both cases default to refDate - c(0.5, 7.5) because those are the outer limits of the dates needed for interpolation.

timriffe commented 3 years ago

OK, I made this change and none of the unit tests failed :shrug: