R/star.R

Defines functions star

Documented in star

#' Returns significance level.
#' 
#' Returns the significance level as stars, or NA if a non-numeric value is
#' passed in.
#' 
#' @param x p-value.
star <- function(x) {
	if(is.numeric(x)) {
		return(cut(x, 
				   breaks=c(-Inf,.001,.01,.05,.1,Inf), 
				   labels=c('***','**','*','.',''))
		)
	} else {
		return(NA)
	}
}

Try the TriMatch package in your browser

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

TriMatch documentation built on May 2, 2019, 12:37 p.m.