I need to work with the data presented above. This question involves a little bit of knowledge of Rstudio. I would (1) like to obtain total revenue PER product (ucp), and brand, (2) sum all observations from product and brands, (3) and then pick up a product (ucp) and brand with largest total revenue in data. (4) Lastly, I would like to create a scatterplot (prices y axis; sales x axis), then fit a straight and quadratic line into the data of the graph.
For now I am stuck with (1), for which I have done the following:
I am not sure how to proceed further, I am not familiar with coding. Again, the name of my data set is "mydata", variables are (upc), and (brand). If anything is unclear, I am attentive and will edit.

R. Stack Overflow is the place to post such questions -- and it is so popular you are likely to find answers just by searching that site. $\endgroup$