Suppose I have the following database
vendas<-c(100,140,200,300,20,1000,200,3000)
vendedor<-c("A","B","A","B","C","C","D","A")
regiao<-c("Norte","Sul","Leste","Norte","Sul","Norte","Leste","Sul")
df<-data.frame(vendedor,regiao,vendas)
And want to look at total sales by seller and by seller / region.
How do I generate this new database with aggregate data for analysis?