Implementing FIR/IIR "alike" filter in R
The function filter() in the signal package does exactly what you are asking for. Note that, by default, it uses ARMA filters (a combination of AR and MA). Thanks to that, you can implement both FIR and IIR filters, because the difference equation for an ARMA model is:

$$y(n) = \sum_{m=0}^{M} a(m)x(n-m)+\sum_{k=1}^{K} b(k)y(n-k)$$

To achieve your FIR filter, note that it is enough to set all $b$ coefficients to $0$. For the IIR filter, you should set $a(0)=1$ and every other value of $a$ to $0$.

Another maybe obvious yet important observation is that you can add the noise $v(n)$ at the end of the script, because the noise is white (at least that's what I understand from your question). Thus, there is no correlation between past and present samples of the noise, letting you adding it after applying the filter.