OD_RF <- read.csv("Odisha_rainfall_blockwise_1991-2021_1 - Copy.csv")'
RF = data.frame(OD_RF)'
RF %>%
group_by(grp = cumsum(Block_10 > 1)) %>%
filter(Block_10 <= 1) %>%
summarise(start_date = min(1990-01-01),
end_date = max(2021-12-31),
rain_acc = sum(Block_10),
days_con = n()) %>%
select(-grp)
And I get following result
A tibble: 1,116 × 4
start_date end_date rain_acc days_con
1 1988 1978 0 47
2 1988 1978 0 3
3 1988 1978 0 4
4 1988 1978 0 3
5 1988 1978 0 2
6 1988 1978 0 5
7 1988 1978 1 12
8 1988 1978 0 2
9 1988 1978 0 1
10 1988 1978 0 3
ℹ 1,106 more rows
ℹ Use print(n = ...)
to see more rows
I have selected date from 1990-01-01 to 2021-12-31, but in the result only year is appearing and that too from 1988 to 1978.
Help me to correct this discrepancy.
I have tried different ranges of date but same situation arises and getting different years that are not even present in my data.
user24862311 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.