Hi I am trying to summarize the data using dplyr. I have a dataset with few columns the code has to filter the data with date_Created column and see if the conditions are matched within the datasets and output a new column with counts (which matches the filtering condition. Let me give an example

I have columns Date_created, Skills, grade. So the first row is picked in the dataset and checked if there are any similar conditions 6 months before if yes then count 1 is added to the column.

eg. Date_created skill grade

2016-09-01 maths 4

2016-10-01 physics 5

2016-03 -01 maths 5

2016-03-01 maths 4

so the output will be in this case the new column count will be 2 for the first row because date_created 2016-03-01 is less than 2016-09-01 twice and the skill is maths and grade is 4 and 4+1,

date_created sklll grade count

2016-09-01 maths 4 2

2016-10-01 physics 5

2016-03 -01 maths 5

2016-03-01 maths 4

Any help would be great, thanks