Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedia committed Mar 22, 2017
2 parents 72a2025 + 3d7e03f commit 66223d9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Suggests:
lattice
Type: Package
Title: Climate data validation in the framework of the COST action VALUE
Version: 1.4.18
Date: 2017-03-17
Version: 1.4.19
Date: 2017-03-22
Authors@R: as.person(c(
"Santander Meteorology Group [aut]",
"Predictia Intelligent Data Solutions [ctb]",
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
R.VALUE
=======

* Introduced "type = min" in index.annual.cycle.filtered
* Introduced relative amplitude in index.annual.cycle.filtered



Expand Down
6 changes: 5 additions & 1 deletion R/index.annual.cycle.filtered.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @template templateIndexParams
#' @template templateDates
#' @param peak = 1 or 2
#' @param type A character string indicating max (default) or min phase (days)
#' @param type A character string indicating max (default), min phase (days), amp (amplitude) or amprel (relative amplitude)
#' @param thresh Threshold that defines weak maxima (relative to amplitude of annual cycle)
#' @return A float number corresponding to the amplitude or the (phase) day of the maxima
#' @export
Expand Down Expand Up @@ -131,6 +131,8 @@ index.annual.cycle.filtered <- function(ts, dates, peak = 1, type = 'max', thres
return(min(ac))
}else if(type == 'amp'){
return(ac[pmax[1]]-min(ac))
}else if(type == 'ampr'){
return((ac[pmax[1]]-min(ac))/ac[pmax[1]])
}
}else if(peak==2){
if(length(pmax)<2){
Expand All @@ -143,6 +145,8 @@ index.annual.cycle.filtered <- function(ts, dates, peak = 1, type = 'max', thres
return(min(ac))
}else if(type == 'amp'){
return(ac[pmax[2]]-min(ac))
}else if(type == 'ampr'){
return((ac[pmax[2]]-min(ac))/ac[pmax[2]])
}
}
}
2 changes: 1 addition & 1 deletion man/index.annual.cycle.filtered.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66223d9

Please sign in to comment.