Skip to content

Commit

Permalink
updated version number, minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kajsamp committed Oct 4, 2024
1 parent ad7a92e commit b2919c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: esd
Version: 1.10.89
Date: 2024-09-03
Version: 1.10.90
Date: 2024-10-04
Title: Climate analysis and empirical-statistical downscaling (ESD) package for monthly and daily data
Author: Rasmus E. Benestad, Abdelkader Mezghani, Kajsa M. Parding, Helene B. Erlandsen, Ketil Tunheim, and Cristian Lussana
Maintainer: Rasmus E. Benestad <rasmus.benestad@met.no>
Expand Down
9 changes: 5 additions & 4 deletions R/as.annual.R
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ leapdate <- function(years="2000", dates="02-29") {
# Not to confuse with season
# This function extracts a given seasonal interval and aggregates a given statistic
#' @export
as.seasons <- function(x,start='01-01',end='12-31',FUN='mean',verbose=FALSE,...) {
as.seasons <- function(x,start='01-01',end='12-31',nmin=NULL,FUN='mean',verbose=FALSE,...) {
if(verbose) print("as.seasons")
yrs <- year(x); d <- dim(x)
# ns = number of stations
Expand Down Expand Up @@ -744,15 +744,16 @@ as.seasons <- function(x,start='01-01',end='12-31',FUN='mean',verbose=FALSE,...)
k[i,] <- apply(matrix(z,ceiling(length(z)/ns),ns),2,nv)
y[i,] <- apply(matrix(z,ceiling(length(z)/ns),ns),2,FUN, ...)
}
y <- zoo(y,order.by=as.Date(paste(years,start,sep='-')))
y <- attrcp(x,y)
if(!is.null(nmin)) y[ k < nmin ] <- NA
y <- zoo(y, order.by = as.Date(paste(years, start, sep='-')))
y <- attrcp(x, y)
attr(y,'history') <- history.stamp(x)
if (twoyears==0) {
attr(y,'season.interval') <- paste(start,'to',end)
} else {
attr(y,'season.interval') <- paste(start,'to',end,'the following year')
}
attr(y,'n.valid') <- k
attr(y, 'n.valid') <- k
class(y) <- class(x)
class(y)[2] <- "season"
#class(y)[2] <- "annual"
Expand Down

0 comments on commit b2919c1

Please sign in to comment.