validate_domain_score: Check whether a CAPL-2 domain score is valid.

View source: R/utilities.R

validate_domain_scoreR Documentation

Check whether a CAPL-2 domain score is valid.

Description

This function checks whether a CAPL-2 domain score is numeric and within a valid range.

Usage

validate_domain_score(x = NA, domain = NA)

Arguments

x

A vector representing a CAPL domain score.

domain

A character vector representing domains within CAPL (valid values are "pc", "db", "mc", "ku"; valid values are not case-sensitive).

Details

Other capl functions called by this function include: validate_number() and validate_integer().

Value

Returns a numeric vector (if valid) or NA (if not valid).

Examples

validate_domain_score(
  x = c(34, 15, 10, 12.5, 25),
  domain = "pc"
)

# [1]   NA 15.0 10.0 12.5 25.0


capl documentation built on April 8, 2022, 9:06 a.m.