Hi @Ronnie! Welcome!
A small note: this is an English language forum, so you're more likely to get answers if you can post your questions in that language.
One good place to start learning about how to do this sort of thing is the Data Transformation chapter of the free book R for Data Science: https://r4ds.had.co.nz/transform.html
To give more specific advice, you'll need to explain exactly what sort of calculations you are trying to do here. It sounds like you want to summarize the table, calculating a sum of renda_mensal_total
for certain groups. What variables do you want to group by? sg_estado
, or something else?
Showing some code you have tried will be very helpful, even if the code doesn't work. Reading this FAQ will help you ask questions here in a way that gets you better, faster answers: FAQ: Tips for writing R-related questions