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

Description Usage Arguments Details Value Examples

View source: R/utilities.R

Description

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

Usage

1
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

1
2
3
4
5
6
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 March 16, 2021, 9:06 a.m.