Thanks for the reply @nirgrahamuk, but unfortunately I got this error.
Error: .i
has an incorrect type.
x It must inherit from Date, POSIXct, or POSIXlt, not character.
Referring to the function you suggest me to use. I tried to convert the "AD" vector to other format (such as double or numeric) before running your function, but the issue still remains.
How can i fix it? I think you suggestion will work.
Thank You,
Andrea