Modern Optimization with R