Skip to content
Snippets Groups Projects
Commit 1beb5b69 authored by Svajunas Plunge's avatar Svajunas Plunge
Browse files

fixed error for plotting phu with short time series

parent b87f9eb6
No related branches found
No related tags found
No related merge requests found
......@@ -270,7 +270,8 @@ prepare_phu <- function(mgt_out, years) {
group_by(hru, year, op_typ) %>%
# ungroup() %>%
# filter(n_op > 1) %>%
mutate(date_diff = diff(date)) %>%
# mutate(date_diff = diff(date)) %>%
mutate(date_diff = lead(date)-date) %>% ##This line avoids error if only one year for crop is available without kill
ungroup() %>%
filter(year %in% years)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment