Try using the count function in dplyr:
library(dplyr)
dat1_frame %>%
count(MONTH.YEAR)
I am not sure how you got MONTH-YEAR as a variable name. My R version does not allow for such a variable name, so I replaced it with MONTH.YEAR.
As a side note, the mistake in your code was that dat1_frame %.% group_by(MONTH-YEAR)
without a summarise
function returns the original data frame without any modifications. So, you want to use
dat1_frame %>%
group_by(MONTH.YEAR) %>%
summarise(count=n())