Reproducible input:
df <- data.frame(
"Date" = sprintf("%02d-Jan", 1:20),
"Type of Weather" = c(rep("Cloudy", 3), rep("Rainy", 7), rep("Cloudy", 5), rep("Sunny", 5))
)
head(df)
Date Type.of.Weather
1: 01-Jan Cloudy
2: 02-Jan Cloudy
3: 03-Jan Cloudy
4: 04-Jan Rainy
5: 05-Jan Rainy
6: 06-Jan Rainy
Expected output: