R/accepted.R

Defines functions accepted

Documented in accepted

NULL
#'
#' This functions lists the realizations which pass successfully Ks or Wilcoxon test.  
#' 
#' @title Which generations pass the tests with success? 
#' 
#' @param tests list of objects returned by \code{\link{wilcox.test}} and \code{\link{ks.test}}
#' @param significance significance for statistical tests (maximum accepted \code{p-Value}). Default is 0.05. 
#' @return Vector with names of successful realizations.
#' 
#' @export
#' @seealso \code{\link{climdex.data.frame}},\code{\link{ks.test}},\code{\link{ks.test.climdex.data.frame}},\code{\link{wilcox.test}}
#' @examples
#' 
#' # See the example of 'climdex.data.frame' function
#'  




accepted <- function(tests,significance=0.05) {
	
	out <- names(tests)
	
	accepted <- array(FALSE,length(out))

	for (i in 1:length(tests)) {
		
		  if (tests[[i]]$p.value>significance) accepted[i] <- TRUE
		
	}
	
	out <- out[accepted]
	
	return(out)
	
}

Try the RClimMAWGEN package in your browser

Any scripts or data that you put into this service are public.

RClimMAWGEN documentation built on May 2, 2019, 3:38 p.m.