Yes, you can do it usring arima.sim, for example.
arima.sim(npts, model=list(ar=a, ma=b), rand.gen=rnorm)
Please note that the model is checked for stationarity, and the above model is not stationary. If you want something integrated, you can specify the order of integration in the model.
source
share