Creating data frames
Summary
20. Profitable offers

Instruction

Great! Let's check whether a given offer is profitable for a particular house seller.

Exercise

It's natural that a client often haggles over the price. The house seller would like to filter out the non-profitable offers. Create a new column called profitable_offer.

The column should contain "No" if the client's offer is more than 20% lower than the original price. Otherwise it should contain "Yes".

Stuck? Here's a hint!

First, create the profitable_offer column and populate it with "Yes":

counteroffers$profitable_offer <- "Yes"

Then, you have to make a proper condition that will filter offers. You can approach this in many ways, here's one of them:

((counteroffers$orig_offer-counteroffers$offer)/counteroffers$orig_offer)*100 > 20