I have a data set in R that looks like the following:
|Date | Paycheck |
|Jan 1st | 1,000|
|Jan 14 | |1,400|
(Sorry for the bad format). I want to create another column that is total yearly salary (so far). I've tried an aggregate function but I get a small data set of ~8 observations when my total data set is ~80. I already have my data broken down by "employee" essentially, so all I need to do is aggregate in my data set.
Thanks for any help.
What I want is:
|Date | Paycheck |Yearly salary to date |
|Jan 1st | 1,000 |1,000|
|Jan 14 | |1,400 |2,400|