I am running a simulation model in R. How do I make the for loop multiply all capacity values and create a list of the average of each profit at the capacity level? Thank you!
BuildCost <- 16.00
SellPrice <- 3.70
VariableCost <- 0.20
OperationCost <- 0.40
Capacity <- c(30000,35000,40000,45000,50000,55000,60000)
Years <- 10
Profs <- c()
for (i in 1:1000){
Demand <- rnorm(1,50000,12000)
FixedCost <- Capacity*BuildCost
AnnualProfit <- Demand * SellPrice
ProductionCost <- Capacity*VariableCost
OperationalCost <- Capacity*OperationCost
TotalProfit <- Years*AnnualProfit-FixedCost-Years*(ProductionCost+OperationalCost)
Profs[i]<- TotalProfit
x <- mean(Profs[i])
}