File: validate.prevalence.R

package info (click to toggle)
r-cran-optimalcutpoints 1.1-5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 432 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
validate.prevalence <-
function(prev) {
	if (prev < 0 || prev > 1) {
		stop("You have entered an invalid value for prevalence. \n Prevalence must be a value higher than 0 and lower than 1.", call. = FALSE)
	}
	if (prev == 0) {
		stop("You have entered an invalid value for prevalence. \n No subject in the population has the disease. Please check this value and \n introduce another valid value. \n Prevalence must be a value higher than 0 and lower than 1.", call. = FALSE)
	}
	if(prev == 1) {
		stop("You have entered an invalid value for prevalence. \n All subjects in the population have the disease. Please check this value and \n introduce another valid value. \n Prevalence must be a value higher than 0 and lower than 1.", call. = FALSE)
  	}
}