How to run a lagged (time series?) model in R?

#1
Hi there,

I am wanting to run a lagged model where a predictor (X) at T1 is regressed on an outcome (Y) at T2, controlling for Y at T1 plus 2 covariates at T1, over a total of 20 time points (so as to test whether X causes Y).

I could use a cross-lagged SEM in Lavaan, but most papers I've read running lagged SEM models use only up to about 5-6 time points - perhaps because too many more time points gets cumbersome?

I've been recommended to check out multivariate ARIMA models in time-series analyses, but as a non-economist, am struggling to see how I can use this approach to run the above model.

Any suggestions for an appropriate approach to modelling ​this in R would be appreciated!

Thank you.