I have a question about R; i would like to use two lags periods instead of one (please check my below code) in my model but i don't know how to whrite it in R. Can someone help please?

sorry, I was wrong about the param name. it is in fact n
it cant be called simultaneously with two n values.
call the function as many times as you want to give a different n.