I have a data frame like this...
Ticker Date rec_count
A 1/1/2019 1
A 2/1/2019 1
A 3/1/2019 1
B 1/1/2019 1
B 2/1/2019 1
B 3/1/2019 1
B 4/1/2019 1
And I basically want to create another variable SUM of the records, so that the new data table would retain all the records in the dataset and include the generated sum field. Like this...
Ticker Date rec_count sum_recs
A 1/1/2019 1 3
A 2/1/2019 1 3
A 3/1/2019 1 3
B 1/1/2019 1 4
B 2/1/2019 1 4
B 3/1/2019 1 4
B 4/1/2019 1 4
I have scoured the internet looking for a solution, but I cannot find one. Please help! I am new to R and while to some this may be an elementary question...it is absolutely driving me crazy!
Thanks!