Hi everyone, I´m brand new to RStudio and I have some difficulties in a quite simple (I suppose) task. For a large dataset (see a short abstract) of "ID" and respective numeric values of a total budget and personnel costs, I want to calculate the share of personnel costs of the total budget per ID in percent.

Of course, I´m able to calculate it manually, but due to the size of the dataset, is it possible to achieve these results by a formula?

Thank you a thousand time for your help in advance!

A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here.