Optimization techniques in RStudio

Good afternoon. I am interested in studying optimization techniques (methods of optimal tasks solving) and their realization in R. Could you,please, recommend me any books (free for downloading) or online courses, which may be helpful for diving into this field of study? They may be either of academic or scientific origin.

Additionally, I'm currently working with forecasting time series with neural networks. I'd be especially pleased if you provide me with links for resources, which contain information about optimizing neural network parameters to get the most accurate forecasts.

Thank you for your effort.