I have a data-set that has 2 columns of time (each column has time in hours before deadline) and 1 column of grade.

Here's how data looks like (sorry, for some reason I cannot upload my test file)

First Last Grade

0.6 0.2 A

0.8 0.5 B-

1.0 0.75 A

1.2 0.8 C+

1.8 1.0 B-

1.8 1.2 B

2.6 2.2 C-

3.0 2.8 B+

3.2 2.5 B

5.0 3.7 A

What I would like to do is, to first sort the data first by column 1, and find the count of grades in a given range of 1 hour time intervals. For example - 0 to 1 hr # of A's is 5, # of B+ is 2 and so on. Then I would like to do the same with respect to column 2. Thirdly do it by group_by both the columns 1 and 2. Followed by this, I want to find percentage of each grade within the hour range and then use the bar plot to plot by hour and put the percentage distribution of grades within that bar plot.

I hope I have been able to explain properly. The biggest hurdle that I have had is to find the number of A's and B's within a given range of time.

Appreciate all the help.

~SD