I think I need you help.
I have a table like this:
Product Price Quantity Quality
1 10 100 100
2 15 1200 88
1 12 88 95
Now, I want to calculate the average mean per product dependent of the Quantity. I have no trouble doing that in Excel, but I don't know how i should solve this problem in R.
If I use something like this:
weighted.mean(Test_weighted_avg$Price, Test_weighted_avg$Quantity, group_by=Product)
the "group_by" function don't work and I don't know, how I can add a second variable. :/
Is there someone who can help me?