Question
in R RStudio >> Build a ShinyApp investigated yesterday install.packages(lpSolve) library(lpSolve) library(lpSolve) # Objective function coefficients obj_coeff
in R RStudio >> Build a ShinyApp
investigated yesterday
install.packages("lpSolve") library(lpSolve)
library(lpSolve)
# Objective function coefficients obj_coeff <- c(6,14)
# Constraint coefficients constraints <- matrix(c(5,15, 4,4, 35,20, 12,28), nrow = 6, byrow = TRUE)
# Direction of logical operators direction <- c("<=", "<=", "<=", "<=") colnames(constraints) = (c("Strawberry" , "Orange")) rownames(constraints) = c("CO2" , "Water" , "Flavor" , "Maximum Profit") constraints
## Strawberry Orange ## CO2 5 15 ## Water 4 4 ## Flavor 35 20 ## Maximum Profit 12 28
#The Maximum Profit is 800 with 12 strawberry batches and 28 orange batches
------------------------------------------------------------------------
#Task 2:
library(lpSolve)
# Objective function coefficients obj_coeff <- c(13,23,30)
# Constraint coefficients constraints <- matrix(c(5,15,10, 4,4,4, 35,20,15, 5,10,20), nrow = 4, byrow = TRUE)
# Direction of logical operators direction <- c("<=", "<=", "<=", "<=" ) colnames(constraints) = (c("Strawberry" , "Orange" , "Grape")) rownames(constraints) = c("CO2" , "Water" , "Flavor" , "Production Time") constraints ## Strawberry Orange Grape ## CO2 5 15 10 ## Water 4 4 4 ## Flavor 35 20 15 ## Production Time 5 10 20 ### This is the matrix Resources # Resources (Right hand side constraints) resources <- c(480, 160, 1190, 800) # calculated Production Time of all labors for 1 month #The max Profit is 1200 With 40 Grape batches # Create the lp sol<-lp( "max", obj_coeff, constraints, direction, resources)
# Max Profit sol$objval
# Best values for objective function sol$solution
#The max Profit is 1200 With 40 Grape batches
______________________________________________________________________
1st Task:
Build a ShinyApp report for the Sodaz Company that:
- Provides enough information about the two case studies you investigated yesterday and the results you achieved.
- Use at least 3 markdown techniques.
- Optional: allow the user to input the limited supply for the ingredients and display the adjusted output results.
- For example, water is 150.
- The output should include both the number of batches and the maximum profit.
2nd Task:
Build a Shiny App using:
- Any of the datasets that come with the library(datasets). For example, you can use mtcars.
- Use the Tidyverse package to allow the user to do at least any 2 of these functions listed below:
- select() to select specific columns.
- filter() to filter the data based on a categorical variable.
- group_by() and summary() to group the data points based on user selection.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started