Hello there and thanks in advance. I have the current problem. I have a dataset that looks like this
data <- data.frame (id = 1:3, A = 1:3, B = 1:3)
Where:
- id are products
- A and B represent the price of every id product on markets A and B, although i might have in future n times markets C,D, etc
My objective is to arrange a solution that shows up where is better to buy every id product.
Something like a data frame showing the best place to buy from every id item.
I have read some optimization packages info, so far i have no clue on how i can get this done. I think those packages might be for more complex tasks.
Your example isn't great, since A and B have the same value in each row; therefore neither A nor B is 'better' (i.e. lower). A more useful example is:
In which case you can do: