Commit 0aff0141 authored by Jana Ulrich's avatar Jana Ulrich
Browse files

change in IDF.agg function to solve error when using monthly subsets

parent 03895576
......@@ -77,14 +77,13 @@
n.na <- sum(is.na(vec))
max <- ifelse(n.na <= na.accept,max(vec,na.rm = TRUE),NA)
return(max)})
return(max) # maxima for single durations
df <- data.frame(xdat=max,ds=ds,year=as.numeric(names(max)))
return(df) # maxima for single durations
}
# call function 1 in lapply to aggregate over all durations at single station
data.agg <- pbsapply(ds,agg.ts,simplify=TRUE,cl=cl)
df <- data.frame(xdat = as.vector(data.agg), ds = rep(ds,each=length(data.agg[,1])))
df$station <- station
df$year <- rep(unique(as.POSIXlt(data.s[,names[1]])$year+1900),length(ds))
data.agg <- pbapply::pblapply(ds,agg.ts,cl=cl)
#browser()
df <- do.call(rbind,data.agg)
return(df) # maxima for all durations at one station
}
# which stations should be used?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment