Wiener-Hopf equation
I guess, you refer to the Wiener-Hopf equation in discrete time for FIR filters.. If this is a homework-task, then I guess most probably you did some mistake in calculation of $R$ (e.g. if you have white noise in the signal, you wont have a singular $R$). 

Anyway, there are some methods to solve this:


You dont necessarily need the inverse of $R$. You need a solution to the problem $RW_{opt}=P$, which leads to $W_{opt}=R^{-1}P$ in case $R$ is regular. However, if $R$ is singular, it may still happen, that $P$ is in the image of $R$. Then, still you can find $W_{opt}$ as the solution to the equation $RW_{opt}=P$. 
(this is just an approximate solution): If you have a singular $R$, you can replace the equation by $W_{opt}=(R+\alpha I)^{-1}P$, i.e. add some regularization factor to the matrix. This will make the system well-defined, but it will not correspond to the exact solution. Note, that in case $R$ is singular and $P$ is not in its image, then there is no exact solution. 
You can go for the pseudo-inverse of $R$. BUt again, this will not correspond to an exact solution, as it does not exist.


All in all, if your $R$ is singular, something is really bad in your model I believe.