Skip to main content
6 of 9
deleted 958 characters in body
user avatar
user avatar

index:length(age_mortality) : argument of length 0 in R

I am trying to use the following defined function to calculate "Reserve" variable.

The detailed of the codes are in the link below. (Except the code I put here, other coding runs perfectly).

I have figure out that is Benefit(0:n) and Benefit(0:last(age_mortality)) led the error. However, my purpose is that I can get a vector start from 0 to n

Anyone know how can I fix this?

(This code shows from line 181 shown in the github file)

user13971133