Could someone help me write this code in R? Linear Programming Problems Question 1: Bill Ding, a successful house flipper, buys houses, invests money to fix them up, then sells them. The following houses have just come onto the market: House Name Buy Invest Sell Days to Complete Simple Man $140,000 $50,000 $220,000 19 The Breeze $135,000 $100,000 $250,000 16 Free Bird $90,000 $75,000 $190,000 21 Three Steps $195,000 $40,000 $275,000 15 That Smell $145,000 $60,000 $225,000 18 Bill has $500,000 to buy+invest and 45 days. Since it is only him, he can only work on one house at a time. Bill wants you to find which houses will maximize his profit (hint: 1. profit is not one of the columns,2. you will need to restate the table, and 3. use all.bin=TRUE because you can't buy the same house more than once).
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Could someone help me write this code in R?
Linear
Question 1:
Bill Ding, a successful house flipper, buys houses, invests money to fix them up, then sells them. The following houses have just come onto the market:
House Name Buy Invest Sell Days to Complete Simple Man $140,000 $50,000 $220,000 19 The Breeze $135,000 $100,000 $250,000 16 Free Bird $90,000 $75,000 $190,000 21 Three Steps $195,000 $40,000 $275,000 15 That Smell $145,000 $60,000 $225,000 18
Bill has $500,000 to buy+invest and 45 days. Since it is only him, he can only work on one house at a time. Bill wants you to find which houses will maximize his profit (hint: 1. profit is not one of the columns,2. you will need to restate the table, and 3. use all.bin=TRUE because you can't buy the same house more than once).
Question 2:
Sal Manilla, a successful restauranteur, is planning a St. Patricks Day sale. He has the following food sales options which can bring in a certain number of new customers (added traffic):
Food Item Cost Sales Price Added Traffic Cake $1.50 $4.99 30 Hot Chocolate $0.30 $2.50 100 Meatloaf $4.25 $14.99 40 Ice Cube $0.10 $0.50 60 Salt-N-Pepa $0.20 $0.75 30
Sal has 250 of each food item available to sell. Also, his restaurant can only accommodate 180 additional customers (added traffic). Sal wants you to find how much of each food item will maximize his profit (sales price - cost).
![Question 1:
Bill Ding, a successful house flipper, buys houses, invests money to fix them up, then sells them. The
following houses have just come onto the market:
House Name
Simple Man
The Breeze
Free Bird
Three Steps
That Smell
Buy
$140,000
$135,000
Food Item
Cake
Hot Chocolate
$90,000
$195,000
$145,000
Meatloaf
Ice Cube
Salt-N-Pepa
Invest
$50,000
$100,000
$75,000
$40,000
$60,000
Sell Days to Complete
Cost
$1.50
$0.30
$4.25
$0.10
$0.20
$220,000
$250,000
$190,000
Bill has $500,000 to buy+invest and 45 days. Since it is only him, he can only work on one house at a
time. Bill wants you to find which houses will maximize his profit (hint: 1. profit is not one of the
columns, 2. you will need to restate the table, and 3. use all.bin=TRUE because you can't buy the same
house more than once).
Question 2:
Sal Manilla, a successful restauranteer, is planning a St. Patricks Day sale. He has the following food
sales options which can bring in a certain number of new customers (added traffic):
$275,000
$225,000
Sales Price Added Traffic
$4.99
$2.50
$14.99
$0.50
$0.75
30
19
16
21
15
18
100
40
60
30
Sal has 250 of each food item available to sell. Also, his restaurant can only accommodate 180
additional customers (added traffic). Sal wants you to find how much of each food item will maximize
his profit (sales price - cost).](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe46938a4-41c8-4e0a-8bdd-05339203ff7b%2Fefdf1c9e-5efd-431b-b173-db36c596fbae%2Fufv6deh_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)