Featured Project: Production Optimization with RStudio
A detailed look at a project where I used RStudio, dplyr, and ggplot2 to optimize production processes and visualize key metrics.

Objective
- Optimize manufacturing production efficiency and reduce downtime using RStudio.
- Use prescriptive analytics to optimize production planning and evaluate investment opportunities.

Approach
- Formulated linear programming models with resource constraints:contentReference[oaicite:2]{index=2}.
- Applied lpSolve in R to maximize revenue given limited labor and materials.
- Simulated company profitability under multiple scenarios (Monte Carlo).
- Visualized feasible regions and optimal solutions using ggplot2.

Results
- Optimized production processes led to a 20% reduction in downtime and a 10% increase in overall efficiency.
- Optimal product mix: 111 units A, 4 units B, 59 units C for $3,618 maximum profit.
- Recommended Company A for investment based on higher expected profitability.
Project Files
1. What this RStudio file does ? (Click the link below)
-
Q1.1 – Baseline LP optimization: Uses lpSolve to maximize total revenue for Products A, B, C subject to labor and materials constraints, returning the optimal production mix and revenue.
-
Q1.3 – Sensitivity on profits: Iteratively bumps the per-unit profit coefficients and re-solves the LP while keeping quantities near the baseline; reports whether higher revenue is achievable within that tolerance.
-
Q1.4 – Scenario without Product B: Re-optimizes with only Products A & C, then plots the feasible region (constraint lines) and marks the optimal solution with ggplot2 to show which constraints are binding at the optimum.
What’s found: The code identifies the profit-maximizing production plan under the given resource limits, shows that modest profit-coefficient tweaks don’t improve revenue (within the set tolerance), and demonstrates that excluding Product B still yields an optimal, fully-utilizing solution—visualized on a clear feasible-region chart.

2. What this RStudio file does ? (Click the link below)
-
Q2.1 – Company Selection: Simulates production levels for Company A (beverages) and Company B (toys) using random distributions, multiplies by profit margins, and compares the expected monthly profits to recommend the more profitable company.
-
Q2.2 – Optimal Production for Company A: Identifies the production quantities of Cola, Lemonade, and Iced Tea that yield maximum profitability within the simulated runs.
-
Q2.3 – Optimal Production for Company B: Finds the optimal production levels of Dolls, Cars, and Puzzles for maximum profitability.
What’s found:
The script estimates which company is the better investment choice based on expected profits. It then pinpoints the optimal production mix for each company’s products. This combines simulation + profit analysis to guide investment and production planning decisions.
How to View and Understand This Project?
You can explore the project in two ways:
Option 1 – Download and Run in RStudio (Recommended)
-
Download the R files from the links above (Production Optimization.R and Profit Simulation.R).
-
Open them in RStudio.
-
Run the code to see:
-
Optimal production mix and maximum revenue (Q1.1, Q1.3, Q1.4).
-
Simulation-based company profitability and product-level optimization (Q2.1, Q2.2, Q2.3).
-
-
Outputs will appear in the Console (numerical results) and Plots tab (visualizations such as feasible regions with optimal solutions).
Option 2 – View R Code in Dropbox
-
If you only want to read the scripts without running them, you can open the files directly in Dropbox using the provided links.
-
This lets you quickly check the structure of the code and see how the models were built.
Read the Project Report (PDF)
-
The PDF provides context, methodology, scenario analysis, and managerial insights that explain the numbers and plots produced by the R scripts.